PDA

View Full Version : Example of EntMake



ccowgill
2007-04-23, 12:30 PM
could someone please post an example of how to use entmake to create a leader with text attached?

thanks,

Adesu
2007-04-25, 12:41 AM
could someone please post an example of how to use entmake to create a leader with text attached?

thanks,

Hi ccowgill,
it's only a sample, if you want special leader modified it as your request.


; leader
(entmake
(list
'(0 . "LEADER")
'(8 . "0")
'(67 . 0)
'(410 . "Model")
'(100 . "AcDbEntity")
'(100 . "AcDbLeader")
'(3 . "Standard")
'(71 . 1)
'(72 . 0)
'(73 . 0)
'(74 . 0)
'(75 . 0)
'(76 . 3)
'(40 . 0.18)
'(41 . 2.55)
'(10 9.54003 13.0494 0.0)
'(10 15.8455 19.9218 0.0)
'(10 22.6422 19.9218 0.0)
'(210 0.0 0.0 1.0)
'(211 1.0 0.0 0.0)
'(212 0.0 0.0 0.0)
'(213 0.0 -0.09 0.0)))
; text
(entmake
(list
'(0 . "MTEXT")
'(102 . "{ACAD_REACTORS")
'(102 . "}")
'(100 . "AcDbEntity")
'(100 . "AcDbMText")
'(10 23.6422 19.9218 0.0)
'(41 . 0.0)
'(42 . 2.55)
'(43 . 0.18)
'(44 . 1.0)
'(71 . 1)
'(72 . 1)
'(1 . "\\A1;Test for leader")
'(7 . "Standard")
'(210 0.0 0.0 1.0)
'(11 1.0 0.0 0.0)
'(50 . 0.0)
'(73 . 1)))

ccowgill
2007-04-25, 11:23 AM
That helps alot, I couldn't figure out how much information was required to create the object, I can see that it is everything except the entity names when entget is used.

I also assume that the handle line is something that AutoCAD assigns?


(5 . "156")

kennet.sjoberg
2007-04-25, 02:39 PM
. . .
I also assume that the handle line is something that AutoCAD assigns?
Yes, and that is a Group code that you can not change or create.

To find out more about Group code, hit the [F1] button inside Vlide
select the tab |Search|
search for : Group codes
then double click one UPPERCASE object
the group code you may not need when entmake is marked (optional) or (optional; default = value )

: ) Happy Computing !

kennet

ccowgill
2007-04-25, 05:25 PM
Thanks, that will help with the program I am writing

awill81226338
2009-08-19, 03:28 PM
Can I get some clarity on the entmake function. I made one to create an mleader and assigned defun c:ld to it. But when I run it, the leader isn't created. I'm wondering if this function is to just list the properties of the entity and use a command to create it visibly. Any clarification would be appreciated.

Thanks,

awill81

irneb
2009-08-24, 11:12 AM
What does the entmake function return? Maybe add something like a (princ (entmake ....)) in your code. This'll display the data on the text screen (press F2). If the data is displayed, there's something else going on (like e.g. the MLeader is placed on an OFF / Frozen layer, or it has an Annotative Scale different from CANNOSCALE and you're on Paper Space).

If it returns nil, it means there's an error with the data list you sent as argument to entmake. Ensure that you don't have group codes -1 and 5 in the data list (these should be created automatically by ACad). After that, follow Adesu's post.

What I usually do is take an entget list, remove the -1 & 5 group codes ... then check if entmake works on this. If it does I open the Devepoler Help on the relevant DXF section. Then I remove (one at a time) some group codes I think may not be needed, then test using entmake. Sometimes you find some codes are marked optional, but are actually required :roll:. This usually happens with these newer composite entities like ML's.

The other solution would be to use ActiveX (vla & vlax) to Add an MLeader onto the Model Space object. It's a bit simpler to get one created than entmake, but you may need to "translate" some data to-and-from Lisp & ActiveX (e.g. SafeArrays & Variants). Of course you may not want to go this route as the ActiveX is "supposed" to be a deprecated library - .NET is the "new-thing".

alanjt
2009-08-24, 04:19 PM
Can I get some clarity on the entmake function. I made one to create an mleader and assigned defun c:ld to it. But when I run it, the leader isn't created. I'm wondering if this function is to just list the properties of the entity and use a command to create it visibly. Any clarification would be appreciated.

Thanks,

awill81
did you just change the above code to multileader?

awill81226338
2009-08-24, 08:37 PM
Thanks guys. I figured it out shortly after I posted it. Guess I just gave up a lil too early.