PDA

View Full Version : vla-move selection set


pnorman
2005-05-31, 11:14 PM
I am using vla-move to move objects in a selection set but as I couldn't find a way to do it directly I came up with the following function to move the objects. I am using ssadd to create SS1 and add objects to it. Am I missing something? Is there a simpler way?


(defun ppn:vla-move-ss (SS P1 P2 / #)
(setq # 0)
(while (<= # (1- (sslength SS)))
(vla-move (vlax-ename->vla-object (ssname SS #)) P1 P2)
(setq # (1+ #))
)
)

(ppn:vla-move-ss SS1 (vlax-3d-point PT1) (vlax-3d-point INSPT))



Thanks

RobertB
2005-06-01, 01:10 AM
Nope, that's the approach needed for the ActiveX Move method.

pnorman
2005-06-01, 04:43 PM
Thanks Robert,

Then I offer these for any who want them:



;(ppn:vla-delete-ss SS1) ;function call

(defun ppn:vla-delete-ss (SS / #)
(setq # 0)
(while (<= # (1- (sslength SS)))
(vla-delete (vlax-ename->vla-object (ssname SS #)))
(setq # (1+ #))
)
)



;(ppn:vla-move-ss SS1 (vlax-3d-point PT1) (vlax-3d-point INSPT)) ;function call


(defun ppn:vla-move-ss (SS P1 P2 / #)
(setq # 0)
(while (<= # (1- (sslength SS)))
(vla-move (vlax-ename->vla-object (ssname SS #)) P1 P2)
(setq # (1+ #))
)
)


;(ppn:vla-rotate-ss SS1 (vlax-3d-point INSPT) ROT)) ;function call

(defun ppn:vla-rotate-ss (SS P1 ROT / #)
(setq # 0)
(while (<= # (1- (sslength SS)))
(vla-rotate (vlax-ename->vla-object (ssname SS #)) P1 ROT)
(setq # (1+ #))
)
)