how to make the autolisp to affect already selected object

how to make the autolisp to affect already selected object

holyhexor0o0
Contributor Contributor
427 Views
5 Replies
Message 1 of 6

how to make the autolisp to affect already selected object

holyhexor0o0
Contributor
Contributor

Hello everyone, I found this nifty autolisp that can align text to a point from the left/right/middle

however it could not affect already selected objects - meaning the user could only select objects after applying the effect

i actually tried with ssget "P" or "I" or clear previous selection but no luck, thanks in advance

0 Likes
Accepted solutions (1)
428 Views
5 Replies
Replies (5)
Message 2 of 6

EnM4st3r
Advocate
Advocate

ssget is affecting already selected objects. So it should work already.
Tried it for the first function and it worked.

0 Likes
Message 3 of 6

komondormrex
Mentor
Mentor

check if variable 'pickfirst' is set to 1. if it is then command should work on preselected objects.

0 Likes
Message 4 of 6

holyhexor0o0
Contributor
Contributor

It already is on, but it still doesn't work on preselected 😄

0 Likes
Message 5 of 6

komondormrex
Mentor
Mentor
Accepted solution

it is command 'undo' that overthrows the preselected set.

replace it with 

(vla-startundomark (vla-get-activedocument (vlax-get-acad-object)))

and 

(vla-endundomark (vla-get-activedocument (vlax-get-acad-object)))

respectively.

0 Likes
Message 6 of 6

holyhexor0o0
Contributor
Contributor

Thank you very much, works like a charm

0 Likes