Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Set Start-Z and End-Z of line to zero Z=0 with MACRO or LISP in unnamed UCS

13 REPLIES 13
Reply
Message 1 of 14
raffanLRBFP
600 Views, 13 Replies

Set Start-Z and End-Z of line to zero Z=0 with MACRO or LISP in unnamed UCS

In my work in AutoCAD, I very often need to assign the beginning and end of a line to the coordinates Z=0

I use 3point UCS to set unnamed UCS with custom line. I need change start Z=0 and End Z=0 to other line staying in this unnamed UCS.
I want to assign keyboard shortcuts to this operation.

 

Thanks for any help in resolving this issue.

13 REPLIES 13
Message 2 of 14
paullimapa
in reply to: raffanLRBFP

Have you tried using the Flatten command or the solutions found on this thread on all your lines first which should change all the z to 0 ?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 3 of 14
raffanLRBFP
in reply to: paullimapa

yes I tried it. But this command move Z=0 in the world UCS
but I need it relative to 3point custom UCS 

Message 4 of 14
cadffm
in reply to: raffanLRBFP

Ae you talking about flatten?

Because the move-macro shouldn't do that.

Try this makro or do manually, move all from 0,0,0 to 0,0,1e99

and back again from 0,0,1e99 to 0,0,0

 

Sebastian

EESignature

Message 5 of 14
paullimapa
in reply to: raffanLRBFP

did you try any of the solutions in that thread which has one that's exactly shown as @cadffm mentioned:

paullimapa_0-1719168031481.png

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 6 of 14
raffanLRBFP
in reply to: cadffm

you mean this macro: ^C^C_UCS;;_select;\_move;_p;;0,0,1e99;;_move;_p;;0,0,-1e99;;
but it works only in world UCS

I set 3point UCS at custom line and need set other line Z=0 relative to this custom unnamed UCS

Message 7 of 14
raffanLRBFP
in reply to: paullimapa

I tried but it doesn't work properly 😞
I have added a video for demo

Message 8 of 14
pendean
in reply to: raffanLRBFP

FLATTEN command not an option? This forum is for AutoCAD, not LT, may I ask why you are trying to use an LT macro? Or does your post need to move the LT forum.

 

OR (for AutoCAD, not LT)... 

https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/how-to-flatten-a-d... 

Message 9 of 14
raffanLRBFP
in reply to: pendean

what is the difference between AutoCAD and AutoCAD LT macros ?
flatten doesn't work with unnamed UCS built by the 3point UCS

 

Message 10 of 14
pendean
in reply to: raffanLRBFP


@raffanLRBFP wrote:

what is the difference between AutoCAD and AutoCAD LT macros ?
flatten doesn't work with unnamed UCS built by the 3point UCS

 


AutoCAD has full access to programming languages that allow for detailed customizations, LT is very limited. And that macro you are testing simply repeats what you can type at the commandline, hardly any intelligence at all.

 

With LISP or the other programming languages let you work with the program's limitations instead of fighting them: perhaps you can give your rotate UCS a temp name then do what you need on the fly. There might be one or more LISP already out there, look for them and give them a try.

Message 11 of 14
cadffm
in reply to: raffanLRBFP


@raffanLRBFP wrote:

you mean this macro: ^C^C_UCS;;_.....


 

No, this macro is not posted in the linked thread, and it isn't want I explained to do it manually, Paul quoted the macro for you above.

The steps are without this red part (UCSenterenter switchs your ucs to wcs, that's why it isn't working for you).

 

cadffm_0-1719266798374.png

 

Sebastian

EESignature

Message 12 of 14
raffanLRBFP
in reply to: pendean

As I work, I create a custom UCS dozens of times in one drawing. If I give temporary names for each UCS, then there will be no point in creating a macro to speed up the process.

Message 13 of 14
raffanLRBFP
in reply to: cadffm

With or without this red part _UCS it doesn't work properly

Message 14 of 14
pendean
in reply to: raffanLRBFP


@raffanLRBFP wrote:

As I work, I create a custom UCS dozens of times in one drawing. If I give temporary names for each UCS, then there will be no point in creating a macro to speed up the process.


Umm, so you don't want the LISP to do all the heavy lifting then @raffanLRBFP?

 

Sample... https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/define-and-address-ucs-in-autolisp/m...

 

 

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

Post to forums  

Technology Administrators


AutoCAD Beta