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

repeat operations with variable data

  • Thread starter Thread starter bnfnrc88
  • Start date Start date

bnfnrc88

Guest
hello to all I am new to the forum and I have a question for me of vital importance. I should have autocad 2008 perform a series of operations such as "paste, revolution, wheel, change view, etc..." such operations are repetitive (macro type) but with possibility to insert variable values to each single command such as point of reference and degrees of rotation, etc... They are generic data but I would like to ask you if it is a persecutable way and possibly if someone is willing to help me. I tried scripts but I couldn't insert variable values. thanks for the attention
 
thanks for the attention. I came to see some manual online....
In particular, as a start, I am trying to make a line that starts from the fixed point p1 (0.0) to the point p2 where the value of the coordinate "y" is constant (0) while the coordinate "x" I must insert it by a real number "lung" (variable example 120.23) that will be divided by 2 as a "meta" variable.
place what I did, which gives me error. Where am I wrong?

p.s. putting "getint" instead of "getreal" works correctly, only that sometimes I have to insert even decimal numbers... .



(setq p1 "0,0")
(setq lung (getreal "\ninserire lung: ")
(setq meta (/diameter 2))
(Sectq height 0)
(seq point (strcat) "," (height)))
(command "_line" p1 point ")
 
(setq lung (getreal "\ninserire lung: ")
(setq meta (/diameter 2))
(Sectq height 0)
(setq point (meta height list))
(command "_line" "0.0" point ")


p.s. sure that "diameter" should not be replaced with "lungh"?
 
(setq lung (getreal "\ninserire lung: ")
(setq meta (/diameter 2))
(Sectq height 0)
(setq point (meta height list))
(command "_line" "0.0" point ")


p.s. sure that "diameter" should not be replaced with "lungh"?
(setq meta (/ diameter 2.0)) because if diameter is a whole, the result will be a whole, forcing 2.0 (real) get a result with real precision.

bye
 
I'll pass as I read it recently.
it is preferable to insert:
(setq meta (* diameter 0.5)) instead of
(setq meta (/diameter 2))
because it seems that the division is slower than multiplication.
 
hello to all and thanks for the tips and corrections. actually "diameter" was replaced with "lung".... said this now also works with real numbers. . .
This is only one step through the resolution of my repetitive operations. . .


I ask you now if it is possible:
1. insert an object copied into another design (_pasteclip)
2. insert it into a point p1 (0.0.0) and attribute it to a "name/tag".

this in order to give for example a "ruote" command compared to the "p1" point that specific object just pasted (with "name/tag" attributed to it by variable and other) without having to select it.

Thank you.
 
you will certainly have used the command to create blocks, so, through _wblock, create the block with a convenient name, insert it through _insert in the other design.
After entering it, the selection (ssget "_l") returns the last institution created.

Hi.
 
perfect.. Thank you very much. In the meantime, I've evaluated another solution.
as sometimes I do not create the block in the starting design, take off the selection in the target design and use the following command:

(setq element (car(nentsel "select item")))

But then I have to make him do a two-point movement, one that is origin and the second that I inserted it with "get point". So I write like this:

(setq origin "0,0,0")
(setq element (car(nentsel "select item")))
(setq point1 (getpoint "\nselect point 1:"))
(command "_.move" element point1 origin")

but don't move it correctly... help... thank you
 
perfect.. Thank you very much. In the meantime, I've evaluated another solution.
as sometimes I do not create the block in the starting design, take off the selection in the target design and use the following command:

(setq element (car(nentsel "select item")))

But then I have to make him do a two-point movement, one that is origin and the second that I inserted it with "get point". So I write like this:

(setq origin "0,0,0")
(setq element (car(nentsel "select item")))
(setq point1 (getpoint "\nselect point 1:"))
(command "_.move" element point1 origin")

but don't move it correctly... help... thank you
(command "_.move" element "" origin punto1 "")
 
Sorry I was wrong, it works properly.... thank you

about the "if" function, I can't understand how to use letters instead of numbers to put conditions. for example as below, I would like to draw a line from origin to a "point" of variable ascissa, depending on which I write the word "hello".

(setq c 20)
(setq a (getstring "insert value: ")
(if (= hi)
(setq b 30)
(setq b 0))
(setq point (list b c))
(command "_line" "0,0,0" point ")

so it doesn't work.... why??? ? Thank you
 
That's right. thanks gp....

Domandona 1: is it possible, defined a rectangle on a certain layer, cut all that remains out of its sides?

domandona 2: I read numerous posts about the transformation of polylinea spline. is it possible to run automatically without having to select the various splines individually?
 
Domandona 1: is it possible, defined a rectangle on a certain layer, cut all that remains out of its sides?

domandona 2: I read numerous posts about the transformation of polylinea spline. is it possible to run automatically without having to select the various splines individually?
for these questions, in order to improve "readability" of the forum discussions, the discussion continues here:
http://www.cad3d.it/forum1/showthread.php?t=17857this to avoid too long discussions with different issues between them.
 

Forum statistics

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

Members online

No members online now.
Back
Top