Jump to content

I wanna move block by editing properties: X, Y, Z and angle


Frederick

Recommended Posts


Hello guys,

I wanna move block by editing properties: Position X, Position  Y, Position Z and angle.

And iam using vla function: (this should move block wich i selected to the point

Point have format (0,0,0)

(setq object (vlax-ename->vla-object (ssname ss 0))) ;selected block

 (vla-put-coordinates object (vlax-3d-point point));change coordinates of the block to 0,0,0
 

Any idea?

Link to comment
Share on other sites

Here is an example for you to learn from although doing it with DXF is much simpler and faster.

(defun c:test ( / s o )
  (and (setq s (car (entsel "\nSelect block to move to 0,0,0 : ")))
       (or (= (cdr (assoc 0 (entget s))) "INSERT")
           (alert "Invalid object selected !")
           )
       (setq o (vlax-ename->vla-object s))
       (or (vla-put-insertionpoint o (vlax-3d-point '(0. 0. 0.)))
           (vla-put-rotation o (* pi 0.25)) ;; rotation angle = 45 Deg.
           )
       )
  (princ)
  ) (vl-load-com)

 

  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...