Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Command UCS with 3 points?

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
maikhanhmst
1410 Views, 7 Replies

Command UCS with 3 points?

Hi everyone,

 

Could someone tell me how to set UCS with 3 points?

Set of points: pt1 (110353.0 -881.248 0.0) origin, pt2 (110453.0 -881.248 0.0) on X-axis, pt3 (110353.0 -781.248 0.0) on Y-axis.

I tried with (command "ucs" "3" pt1 pt2 pt3). The command line showed 

"Coincident with first point
; error: Function cancelled"

 

Thank you.

7 REPLIES 7
Message 2 of 8
hmsilva
in reply to: maikhanhmst

Try

 

(setq pt1 '(110353.0 -881.248 0.0)
      pt2 '(110453.0 -881.248 0.0)
      pt3 '(110353.0 -781.248 0.0))
(command "ucs" "3" "_NONE" pt1 "_NONE" pt2 "_NONE" pt3)

 

Henrique

EESignature

Message 3 of 8
marko_ribar
in reply to: hmsilva

Note that your UCS is the same as WCS only moved to different origin...

 

(command "_.UCS" "_W")
(command "_.UCS" "_M" "_none" '(110353.0 -881.248 0.0))

 Kr., M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)
Message 4 of 8
maikhanhmst
in reply to: marko_ribar

Thank you so much.
Message 5 of 8
maikhanhmst
in reply to: hmsilva

Many thanks Henrique.
Could you tell me what "_none" means in the command?
Message 6 of 8
hmsilva
in reply to: maikhanhmst


@maikhanhmst wrote:
Many thanks Henrique.
Could you tell me what "_none" means in the command?

You're welcome, maikhanhmst.

 

The "_none" is the Object Snap Mode 'None'.

Wen we use Command calls with points as argument, we should use the 'none' to ensure that the point provided to the command is the desired point and not a point resultant from some other Object Snap Mode.

Or set a variable with the current OSMODE value, set OSMODE to 0, run the command, and set OSMODE to the stored value.ie

(setq osm (getvar 'OSMODE))

(setvar 'OSMODE 0) 

(command "ucs" "3" pt1 pt2 pt3)

(setvar 'OSMODE osm)

 

Henrique

 

 

EESignature

Message 7 of 8
maikhanhmst
in reply to: hmsilva

Great. Actually, before I get your answer I 'd figured out why I couldn't set the UCS to the set of the points. I tried turn off the osmode and it worked with my code. WIth your explaination, I understand better now. Thanks.
Message 8 of 8
hmsilva
in reply to: maikhanhmst

Glad you got it sorted!

Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost