Jump to content

Recommended Posts

Posted (edited)

Hi good day !

 

Please help me revise this LISP. The lisp calculating the center of the blocks and use it as a basepoint. I want to revise which it will use the true basepoint on the blocks. hope anyone can get my point. thank you in advance have a great day ahead.

 

 

 

 

(defun C:ROB (/ SS LL UR MPT)
  (vl-load-com)
  (if (setq SS (ssget ":L"))
    (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS)))
      (setq obj (vlax-ename->vla-object ent))
      (vla-getboundingbox obj 'minpt 'maxpt)
      (setq LL (vlax-safearray->list minpt)
            UR (vlax-safearray->list maxpt)
            MPT (mapcar '/ (mapcar '+ LL UR) '(2 2 2))
      )
      (vl-cmdf "_.Rotate" ent "" "_non" MPT pause)
    )
  )
  (princ)
)

 

Edited by SLW210
Added Code Tags!
Posted

Please use code tags for your code. (<> in the editor toolbar)

Posted

Might not work been out of the lisp game for a hot min. remember autocad need like 3dpoint or something. can just use the dxf directly. should work with BricsCAD.

 

(defun C:ROB (/ SS base)
  (vl-load-com)
  (if (setq SS (ssget '((0 . "INSERT") (410 . "Model"))))
    (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS)))
      (setq base (cdr (assoc 10 ent)))  
      (command "_.Rotate" ent "" "_non" base pause)
    )
  )
  (princ)
)

 

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...