Steven P Posted March 18 Posted March 18 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 Quote
pkenewell Posted March 18 Posted March 18 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). Quote
Steven P Posted March 18 Author Posted March 18 (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 March 18 by Steven P 1 Quote
Lee Mac Posted March 18 Posted March 18 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). 1 Quote
Steven P Posted March 18 Author Posted March 18 Thanks Lee, I tried that - I'll check what I did tomorrow, I'll have an error somewhere Quote
Lee Mac Posted March 18 Posted March 18 (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 March 18 by Lee Mac 2 Quote
Steven P Posted March 18 Author Posted March 18 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 Quote
pkenewell Posted March 19 Posted March 19 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. 1 Quote
Steven P Posted March 19 Author Posted March 19 pkenewell, yes, only going to be asking the tricky ones! It is all working now I think 1 Quote
Recommended Posts
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.