Jump to content

Recommended Posts

Posted

Here is one I am stumped on, hoping someone has something hidden away somewhere.

 

In my block creating LISP I am adding Leaders (never needed them before, I do now):

Open a new block definition

Draw the entities - including leaders

Close the block definition

Insert the block

 

Using EntMake methods to do this - the background database just needs the numbers for the entity and coordinates - can be efficient only saving the minimum data that you need.

 

So Entmake a leader into the block definition all works nice... except (so far) to adjust the arrow size... Does anyone have any nice code that will do this for me?

 

I've tried (vlax-put-property (vlax-ename->vla-object (entlast)) 'ArrowheadSize 2.5) ... but not working - I think probably because I haven't inserted the block at this point the leader doesn't 'exist'

 

Entmake... suspect I'd have to be going into the entities that the leader contains, but which one?

 

 

 

Any guidance is good, thanks

 

 

Posted
  On 3/18/2025 at 9:00 PM, Steven P said:

I think probably because I haven't inserted the block at this point the leader doesn't 'exist'

Expand  

@Steven P you nailed it on the head: If you are using vla objects you need to create the leader first within the block definition, then set the property for the resulting object. if using (entmake), you can do it at creation using DXF code 42 i.e. (42 . 2.5).

Posted (edited)

I've literally just turned it all off for the night.... 42. will try that one

 

 

Wasn't working for qleader, multileaders I think it does.

 

Edited by Steven P
  • Like 1
Posted
  On 3/18/2025 at 9:00 PM, Steven P said:

I've tried (vlax-put-property (vlax-ename->vla-object (entlast)) 'ArrowheadSize 2.5) ... but not working - I think probably because I haven't inserted the block at this point the leader doesn't 'exist'

Expand  


The leader entity still exists within the drawing database, the owner is simply the block definition rather than the Modelspace/Paperspace block; rather than using (entlast), you can use the entity name returned by (entmakex).

  • Like 1
Posted

Thanks Lee, I tried that - I'll check what I did tomorrow, I'll have an error somewhere

Posted (edited)
  On 3/18/2025 at 9:32 PM, pkenewell said:

if using (entmake), you can do it at creation using DXF code 42 i.e. (42 . 2.5).

Expand  


Presumably you're assuming an MLEADER as opposed to a LEADER? For a LEADER entity, an arrowhead size override is set within the extended entity data, e.g.:

 

(defun c:myleader ( / p q s )
    (if (and (setq p (getpoint "\n1st point: "))
             (setq q (getpoint "\n2nd point: " p))
             (setq s (getdist "\nSpecify arrowhead size: "))
        )
        (progn
            (regapp "ACAD")
            (entmake
                (list
                   '(0 . "LEADER")
                   '(100 . "AcDbEntity")
                   '(100 . "AcDbLeader")
                    (cons 10 (trans p 1 0))
                    (cons 10 (trans q 1 0))
                    (list -3
                        (list
                            "ACAD"
                           '(1000 . "DSTYLE")
                           '(1002 . "{")
                           '(1070 . 41)
                            (cons 1040 s)
                           '(1002 . "}")
                        )
                    )
                )
            )
        )
    )
    (princ)
)

 

Edited by Lee Mac
  • Like 2
Posted

That's prefect thanks Lee, I should have asked this at dinner time... (but the I won't have learned what doesn't work if I had)

 

 

 

 

... mleaders later in the week... maybe

Posted
  On 3/18/2025 at 9:50 PM, Lee Mac said:

Presumably you're assuming an MLEADER as opposed to a LEADER?

Expand  

 

Yes - I was thinking MLEADER instead of LEADER. Didn't realize Steven P was talking about the old style Leaders. The old leaders were "governed" by dim variables.

  • Like 1
Posted

pkenewell, yes, only going to be asking the tricky ones! It is all working now I think

  • Like 1

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