Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

entmake problem

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
143 Views, 4 Replies

entmake problem

I am having problems using the “entmake” function when it comes to “MLINE”. I have all the multi-lines already in my drawing. All layers and line types are preset so that’s not a problem either. Using the examples given in the books this is what I have so far.

(entmake (list
(cons 0 "MLINE")
(cons 2 "24P")
(cons 10 PT1)
(cons 11 PT2)
)
)

Thanks for the help.
Jofireman
4 REPLIES 4
Message 2 of 5
BillZ
in reply to: Anonymous

I don't think you have enough information in your list to create an mline.

Check the help files on DXF group codes for an mline.

Bill

Mline group codes

Group codes
Description

100
Subclass marker (AcDbMline)

2
String of up to 32 characters. The name of the style used for this mline. An entry for this style must exist in the MLINESTYLE dictionary.
Do not modify this field without also updating the associated entry in the MLINESTYLE dictionary

340
Pointer-handle/ID of MLINESTYLE object

40
Scale factor

70
Justification: 0 = Top; 1 = Zero; 2 = Bottom

71
Flags (bit-coded values):
1 = Has at least one vertex (code 72 is greater than 0)
2 = Closed
4 = Suppress start caps
8 = Suppress end caps

72
Number of vertices

73
Number of elements in MLINESTYLE definition

10
Start point (in WCS)
DXF: X value; APP: 3D point

20, 30
DXF: Y and Z values of start point (in WCS)

210
Extrusion direction (optional; default = 0, 0, 1)
DXF: X value; APP: 3D vector

220, 230
DXF: Y and Z values of extrusion direction (optional)

11
Vertex coordinates (multiple entries; one entry for each vertex) DXF: X value; APP: 3D point

21, 31
DXF: Y and Z values of vertex coordinates

12
Direction vector of segment starting at this vertex (multiple entries; one for each vertex)
DXF: X value; APP: 3D vector

22, 32
DXF: Y and Z values of direction vector of segment starting at this vertex

13
Direction vector of miter at this vertex (multiple entries: one for each vertex)
DXF: X value; APP: 3D vector

23, 33
DXF: Y and Z values of direction vector of miter

74
Number of parameters for this element (repeats for each element in segment)

41
Element parameters (repeats based on previous code 74)

75
Number of area fill parameters for this element (repeats for each element in segment)

42
Area fill parameters (repeats based on previous code 75)



The group code 41 parameterization is a list of real values, one real per group code 41. The list may contain zero or more items. The first group code 41 value is the distance from the segment vertex along the miter vector to the point where the line element's path intersects the miter vector. The next group code 41 value is the distance along the line element's path from the point defined by the first group 41 to the actual start of the line element. The next is the distance from the start of the line element to the first break (or cut) in the line element. The successive group code 41 values continue to list the start and stop points of the line element in this segment of the mline. Linetypes do not affect group 41 lists.

The group code 42 parameterization is also a list of real values. Similar to the 41 parameterization, it describes the parameterization of the fill area for this mline segment. The values are interpreted identically to the 41 parameters and when taken as a whole for all line elements in the mline segment, they define the boundary of the fill area for the mline segment.

A common example of the use of the group code 42 mechanism is when an unfilled mline crosses over a filled mline and mledit is used to cause the filled mline to appear unfilled in the crossing area. This would result in two group 42s for each line element in the affected mline segment; one for the fill stop and one for the fill start.

The 2 group codes in mline entities and mlinestyle objects are redundant fields. These groups should not be modified under any circumstances, although it is safe to read them and use their values. The correct fields to modify are as follows:

Mline

The 340 group in the same object, which indicates the proper MLINESTYLE object.

Mlinestyle

The 3 group value in the MLINESTYLE dictionary, which precedes the 350 group that has the handle or entity name of the current mlinestyle.
Message 3 of 5
Anonymous
in reply to: Anonymous

Just return the (entget (car (entsel))) Remove the reference, like entityname, and the handle. And if it's missing the 100 dxfs, add them in. I haven't personally played around with mlines. "jofireman" wrote in message news:28200188.1077196436626.JavaMail.jive@jiveforum1.autodesk.com... I am having problems using the "entmake" function when it comes to "MLINE". I have all the multi-lines already in my drawing. All layers and line types are preset so that's not a problem either. Using the examples given in the books this is what I have so far. (entmake (list (cons 0 "MLINE") (cons 2 "24P") (cons 10 PT1) (cons 11 PT2) ) ) Thanks for the help. Jofireman
Message 4 of 5
Anonymous
in reply to: Anonymous

MLines are the devil's tool to entmake. :) One suggestion you might try (btw, I haven't tried this yet, so I don't know how well it would work - but it's pretty high up on of my list - and it SHOULD work...) Set yer mlinestyle, scale, and justification for yer mline'o'choice current. (CMLSTYLE, CMLSCALE, CMLJUST sysvars) Round up all yer vertices. THEN use vla-add-mline or other such function to pop that baby in there. Entmaking a mline will send you home bawling anyway, so I don't know what you've got to lose. :) Otherwise, try using (command "MLINE" pt1 pt2...) hth, David Kozina "jofireman" wrote in message news:28200188.1077196436626.JavaMail.jive@jiveforum1.autodesk.com... I am having problems using the “entmake” function when it comes to “MLINE”. I have all the multi-lines already in my drawing. All layers and line types are preset so that’s not a problem either. Using the examples given in the books this is what I have so far. (entmake (list (cons 0 "MLINE") (cons 2 "24P") (cons 10 PT1) (cons 11 PT2) ) ) Thanks for the help. Jofireman
Message 5 of 5
scot-65
in reply to: Anonymous

:

Jofireman,

When I started my LISP illness, I avoided two conditions:

1) Breaking an existing entity into two or more new entities.

2) Using ENTMAKE.


Let the editor create the entity under default environment
and use ENTLAST to tailor the entity to your liking.
A subroutine for ENTMOD should be in order...

Scot-65

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost