how to create routine to mimic - pick viewport, pick grip, pick new location

how to create routine to mimic - pick viewport, pick grip, pick new location

Anonymous
Not applicable
751 Views
3 Replies
Message 1 of 4

how to create routine to mimic - pick viewport, pick grip, pick new location

Anonymous
Not applicable

I would like to be able to mimic the following steps in AutoLisp -

Pick a Viewport

Pick a grip

Pick a new location

 

I've gotten as far as

(and
(setq EL (entget (entlast)))
(= "VIEWPORT" (cdr (assoc 0 EL)))
(setq VPobj (vlax-ename->vla-object (cdr (assoc -1 EL))))
(setq P1 (getpoint "\nPick OLD location of Viewport corner to move or [Enter]=no move ? "))
(setq P2 (getpoint P1 "\nPick NEW location for Viewport corner ? "))
(setq VPc (vlax-safearray->list (vlax-variant-value (vla-get-center VPobj))))
(setq VPh (vla-get-height VPobj))
(setq VPw (vla-get-width VPobj))
(setq PLL (list (- (car VPc) (/ VPw 2.0)) (- (cadr VPc) (/ VPh 2.0)) 0.0))
(setq PLR (list (+ (car VPc) (/ VPw 2.0)) (- (cadr VPc) (/ VPh 2.0)) 0.0))
(setq PUL (list (- (car VPc) (/ VPw 2.0)) (+ (cadr VPc) (/ VPh 2.0)) 0.0))
(setq PUR (list (+ (car VPc) (/ VPw 2.0)) (+ (cadr VPc) (/ VPh 2.0)) 0.0))
(member P1 (list PLL PLR PUL PUR))
)

 

0 Likes
752 Views
3 Replies
Replies (3)
Message 2 of 4

Kent1Cooper
Consultant
Consultant

Pardon my asking, but....  What is the advantage of doing this with an AutoLisp routine, when you can just, you know, do  it?  It doesn't appear that your idea for a routine saves anything in terms of the usual purpose -- shortcutting User input.  Are you perhaps just wanting to have the prompts spelled out as "instructions" to the User?  If so, does anyone who knows enough to recognize what the prompts are asking not know how to do it without them?

Kent Cooper, AIA
0 Likes
Message 3 of 4

Anonymous
Not applicable
I have a command to create a viewport, allow the user to pan and zoom around to get a building centered, the program then scales the viewport, allows the user to freeze the viewport scale, then insert a detail bubble block. Since the user doesn't know the size needed for the viewport, I want to be able let the user change 1 corner of the viewport between scaling and locking the viewport.
0 Likes
Message 4 of 4

john.uhden
Mentor
Mentor

Maybe telekinetics will be introduced in the next release.

 

Remember that stand-up comedian?  "All those who believe in telekinesis, please raise my hand."

John F. Uhden

0 Likes