Jump to content

Drawing Trays - command sequence


Sambuddy

Recommended Posts

how do I get the first part to work? how do I combine the two?

 

How do I have it so first pline is drawn/executed, followed by then (c2 command) measure command to insert specific block and then (c3 command) which is offset on both sides and delete original is executed?

 

as you can see it looks so bad...

please help

(defun c:c2 (/ d1)
(setq d1 (entget (car (entsel))))
  (setq d2 (command "_.measure" "d1" "B" "Tx - Dalle béton + tapis" "Y" "1200" "")) 
)

(vl-load-com)
(defun c:c3 ( / *error* of undo doc ss )
  (defun *error* ( msg )
    (and undo (vla-EndUndomark doc))
    (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
        (princ (strcat "\n** Error: " msg " **")))
    (princ))

  (if (and (ssget '((0 . "ARC,CIRCLE,ELLIPSE,*LINE")))
           (setq of (getdist "\nSpecify Offset Distance: ")))
    (progn
      (setq undo (not (vla-StartUndomark (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))))))
      (vlax-for obj (setq ss (vla-get-ActiveSelectionSet doc))
        (mapcar (function (lambda (o) (vl-catch-all-apply (function vla-offset) (list obj o))))
                (list of (- of)))
        (vla-delete obj))
      
      (setq undo (vla-EndUndoMark doc))))
  (princ)
)

 

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