• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

changes to the offset command

  • Thread starter Thread starter b_alexx
  • Start date Start date

b_alexx

Guest
Hello everyone
I'd like to put a problem to the community and see if it's possible to get help.
Attached I put a lisp that, once loaded, simply by typing a numerical value between 1 and 255 allows to change the color of the selected entities with the color of the number typed. For example, without any active command, I type 20 and select the entities I want to change the color becomes 20 color (red color). (without switching from property or layer)

Now I'll tell you what my problem is.
The command offset, probably or at least as far as I'm concerned, is one of the most used, so I'd like to streamline the procedure. In practice I would like to use the same system for the color change of which the attached lisp.
I have good lisp infarinations but not so that I can adapt it for the offset command.
I have made several attempts, maybe approaching the result but nothing usable.
It is obvious that the presence of decimals in the lisp and not only whole numbers, increases the difficulty.
in practice if, as in the lisp of the change colors, I type ".25" by selecting the entity from the part where I click perform the offset of 0.25.
If this could be done, some "digits" would be saved, multiplied by the number of times when you run the command would be many.

Thank you for your interest.
 

Attachments

Allow me. . .

normal procedure:
offset-> object-> point where to make the offset.
procedure you would like to adopt:
lisp offset->distance-> object-> point where to make offset.

What changes?
already that of the color change makes sense only if you often use colors (different) beyond the 7, otherwise select objects and change them from the color pop.
But this, I just don't understand what would save you.
 
Hi.
ok for that of colors, using several for color drawings, saving several steps. normal procedure : select entities, from the properties' swipe up to the bottom for the choice of color from the palette, select the color, ok. with the lisp, obviously I know the numbers of all colors, type and just the color desired.
for the offset (the lisp is resident so I don't have to launch it every time or click on the lisp icon) basically saves the launch of the keyboard command or icon.

thanks for the interest
 
a clarification.
for the offset command the utility is actually limited, but this method would allow in other remarkable "velocization" commands.
command breaks at one point. select entity, specify second stop point or first point, first point, second point. with the lisp select entities automatically verify the intersection closest to the click and break at that point. so only 1 click instead of 3. and so for many other commands.
Hi.
 
Hi.
ok for that of colors, using several for color drawings, saving several steps. normal procedure : select entities, from the properties' swipe up to the bottom for the choice of color from the palette, select the color, ok. with the lisp, obviously I know the numbers of all colors, type and just the color desired.
for color change because not:

(command "_chprop" breaks "_c" breaks ")
 
Hi.
Thanks for the answer.
with the macro that proponi (good) there are according to me 2 drawbacks:
1) I have to select each entity individually (you can't with the macro use selection windows)
2) I still have to call the macro (from keyboard or icon) then an extra digit. (with the "resident" lisp just type the number that automatically recalls the lisp).
Hello and thank you.
 
Hi.
Thanks for the answer.
with the macro that proponi (good) there are according to me 2 drawbacks:
1) I have to select each entity individually (you can't with the macro use selection windows)
is not a macro but a piece of lisp (for the precission).
for multiple selection you can do:
(command "_chprop" (ssget) ""_c" pauses "")
2) I still have to call the macro (from keyboard or icon) then an extra digit. (with the "resident" lisp just type the number that automatically recalls the lisp).
Hello and thank you.
not what you mean by "resident" (I think you intend to bind the program to the name of a command) but you can do:
(defun c:nome_che_vuoi () (command "_chprop" (sssget) "_c" pauses")) and then type the command name_che_vuoi.
 
Hi.
by resident I mean that I don't have to load it every time to get it started but I add it to the start group in the file loading dialog.
with your example, however, I have to launch the command to start the file with what I attached, try, there's no need to "launch it." Just type (without any active command) any number between 1 and 255 and you will see that immediately asks you to select entities.

(eval (read (strcat "(defun c:" (itoa i) (chr 40) (chr 41) (okc " (itoa i))))))))

The string above is the name of the lisp that, random, changes the name to the lisp itself according to the number typed on the keyboard.

Hi. and thank you for your availability.
 
ciao
by resident I mean that I don't have to load it every time to get it started but I add it to the start group in the file loading dialog.
once loaded (from start group with appload) the command remains loaded.
with your example, however, I have to launch the command to start the file with what I attached, try, there's no need to "launch it." Just type (without any active command) any number between 1 and 255 and you will see that immediately asks you to select entities.
practically when you type a number (from 1 to 255) and then send you are "launching" a command that is called as the number in question.
the same as writing name_che_vuoi and then sending.

in your versions call the command-> select objects.

in the example which name_che_vuoi call the command-> select the objects-> choose the color.

you have one step less but 254 extra functions...
preferences do not discuss. Hello, good job.
 
thanks rpor66

the lisp presents the same problem I exposed in my first post. using decimals (e.g. 0.25) are not recognized.

anyway thanks the same.
 
with this change accepts decimals as long as using the comma as a separator, then 0.25 instead of 0.25.
Unfortunately the . does not pass as a parameter, if someone knows how to ovviare would do what you like.
bye
 

Attachments

thanks rpor66
sin for the comma in place of the point. If you find the way to solve it would be perfect. It's not bad, anyway.

Thank you.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top