Jump to content

Rotate and Scale a SS using a Variable Stored Base Point with reference and point


scubastu

Recommended Posts

What is the format for the scale and rotate commands.. and can I use a stored point as variable as my base point to rotate/scale a selection set?

I want to rotate and scale by ®eference and (P)oints using variables also..how? Command "rotate" sset basept1 "r" pt1 pt2 "p" pt1 pt3 ????:?

 

so far no joy!

Link to comment
Share on other sites

For sure you can input either as strings or as variables when “feed” the command statement (presuming thePoint variable is storing a 2D or 3D point):

 

(command "_POINT" "0,0,0") or (command "_POINT" thePoint)

 

 

 

Regarding your code example, you should close the selection process ( = "") before proceed to input other to command statement:

 

(command "ROTATE" sset [b]""[/b] basept1 "R" pt1 pt2 "P" pt1 pt3)

 

And adding a "_" before commands and options may be a good practice since this ensure your code will run smoothly in localized versions of AutoCAD:

 

(command "_ROTATE" sset [b]""[/b] basept1 "_R" pt1 pt2 "_P" pt1 pt3)

 

Regards,

Link to comment
Share on other sites

Thanks again MSASU! works a treat.. I almost had it ..apart from rotating and scaling on the wrong stored point from my loop (I needed my first picked point from counter 1) not the second last one (pickpoint 1 but counter >1)! woops! Now I just gotta sort my brackets and order of things! ..almost done (I think).

Link to comment
Share on other sites

If you are rotating and scaling in the same function, why no use Align?

 

or

align
(align arg1 arg2 ...)
Arguments
arg1 arg2... Arguments to the AutoCAD align command. The order,
number, and type of arguments for the align function are
the same as if you were entering ALIGN at the command
line.
To indicate a null response (a user pressing ENTER ), specify
nil or an empty string ("").
Return Values
T if successful, otherwise nil.
Examples
The following example specifies two pairs of source and destination points,
which perform a 2D move:
(setq ss (ssget))
(align ss s1 d1 s2 d2 "" "2d")

Link to comment
Share on other sites

Thanks! wow.. never new about that.. took me a little to figure out s1 and d1 are the same (if using basepoint - which I am) and replace "2d" with "Y" for scaling but finally got it! certainly tidies up my lisp. Thanks again.

Link to comment
Share on other sites

Thanks! wow.. never new about that.. took me a little to figure out s1 and d1 are the same (if using basepoint - which I am) and replace "2d" with "Y" for scaling but finally got it! certainly tidies up my lisp. Thanks again.

:)

I remember thinking about all the time I spent rotating then scaling objects when I first learned about align.

Link to comment
Share on other sites

Hi Alanjt, just a question about the 'Align' command.. I separated my lisp yesterday into two and re-wrote the second (with align command) to encompass any missing data left out from the first lisp (with regards to points needed).. now align doesn't register as a function.. i.e. Command: ; error: no function definition: ALIGN

 

I tried putting (command "_align" etc..)and it ran the command asking for points and ignored my variables so I reverted back to (align etc..) and it runs again.. do I have to "call" the command to my program?

Link to comment
Share on other sites

Hi Alanjt, just a question about the 'Align' command.. I separated my lisp yesterday into two and re-wrote the second (with align command) to encompass any missing data left out from the first lisp (with regards to points needed).. now align doesn't register as a function.. i.e. Command: ; error: no function definition: ALIGN

 

Does it only become available after a creating of an object or two? There is nothing mentioned in help.

 

Because the geom3d.arx isn't loaded until the actual Align command (or something else that comes from that .arx file) is executed. However, you just have to load the .arx file if you want to use it. Try putting this before you call align:

(or align (arxload "geom3d.arx"))

Link to comment
Share on other sites

Perfect! Thanks again! These are the little things that make being on this site so valuable!

 

blurb...

With my Lisp.. I'm writing a Surveying Traverse lisp and adjustments lisp to kill time while we have a quiet period at work. It inserts blocks at the end of each traverse line and writes the input to a text file. I'm just looking at adjustments now and thanks to you it all works sweetly.. just going to carry on to write the adjustments to file now too and add radiation capability for each "station" (block) to the traverse lisp. I know there is a surveying package under Land Desktop but this lisp writing was inspired by making an easier input method for my workmates when entering line by direction.. e.g. default autocad Dir = anticlockwise, Base ang= East , input for line = @dist

 

cheers Stu

Link to comment
Share on other sites

Perfect! Thanks again! These are the little things that make being on this site so valuable!

 

blurb...

With my Lisp.. I'm writing a Surveying Traverse lisp and adjustments lisp to kill time while we have a quiet period at work. It inserts blocks at the end of each traverse line and writes the input to a text file. I'm just looking at adjustments now and thanks to you it all works sweetly.. just going to carry on to write the adjustments to file now too and add radiation capability for each "station" (block) to the traverse lisp. I know there is a surveying package under Land Desktop but this lisp writing was inspired by making an easier input method for my workmates when entering line by direction.. e.g. default autocad Dir = anticlockwise, Base ang= East , input for line = @dist

 

cheers Stu

Good luck. If you need any help, just ask. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...