Jump to content

Drawing Mutlileaders in DXF and Visual Lisp


Recommended Posts

Posted (edited)

Anyone know how to draw a multileader using visual lisp and dxf?

 

Kind Regards,

 

Matt

Edited by harrison-matt
Posted
(defun c:test1 ()
 (setq aspace
 (if (= 1
 (vla-get-activespace
   (setq doc (vla-get-activedocument (vlax-get-acad-object)))
 )
     )
   (vla-get-modelspace doc)
   (vla-get-paperspace doc)
 )
 )
 (while (setq p0 (getpoint))
   (vlax-invoke aspace
  'addmleader
  (append p0 (polar p0 (/ pi 4) 3))
  0
   )
 )
)

Posted

It works great, my only question is: If my current leader style contains a user defined block, where can i specify the program to include the block when drawing the mleader?

 

Matt

Posted
It works great, my only question is: If my current leader style contains a user defined block, where can i specify the program to include the block when drawing the mleader?

 

Matt

 

If your current Mleader style does have a user defined block, thene verytime you use this it shows the block

 

Now, this is an overide

 

(defun c:test1 ()
 (setq aspace
 (if (= 1
 (vla-get-activespace
   (setq doc (vla-get-activedocument (vlax-get-acad-object)))
 )
     )
   (vla-get-modelspace doc)
   (vla-get-paperspace doc)
 )
 )
 (while (setq p0 (getpoint))
[color=blue](vla-put-arrowheadblock[/color]
   (vlax-invoke aspace
  'addmleader
  (append p0 (polar p0 (/ pi 12) 9))
  0
   )
   [color=blue] "YourBlockName")[/color]
 )
)

 

you can use variable for the block name, but you need to know the block name beforehand or add a prompt for the block name :)

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