• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Visual LISP, AutoLISP and General Customization

    Reply
    Contributor
    Posts: 18
    Registered: ‎08-30-2012

    Entmake Insert with Multiline Attributes.

    213 Views, 2 Replies
    08-30-2012 11:47 AM

    I want to entmake a block with a multiline attribute. Entmaking the block definition works fine, but what do I code for the Multiline Attribute? Should it be coded (0 . "MTEXT") instead of (0 . "ATTRIB")? I know (101 . "Embedded Object") does not work. What other codes need to be included?

     

    THANX

    Please use plain text.
    Mentor
    Posts: 246
    Registered: ‎12-04-2009

    Re: Entmake Insert with Multiline Attributes.

    08-30-2012 05:04 PM in reply to: anim8er3

    Hui....

    Spoiler
    :smileywink:

    Please  you upload here one block example in the version autocad2004...

     

     

    Please use plain text.
    Contributor
    Posts: 18
    Registered: ‎08-30-2012

    Re: Entmake Insert with Multiline Attributes.

    08-31-2012 06:26 AM in reply to: diagodose2009

    This code will make the block definition:

     

    (defun BLK-TEST (/ )
    (entmake (list '(0 . "BLOCK") '(100 . "AcDbEntity")  '(8 . "0") '(100 . "AcDbBlockBegin") '(70 . 2) '(10 0.0 0.0 0.0) '(2 . "MTRL-TBL-BOD") '(1 . "")))
    (entmake (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(67 . 1) '(8 . "TABLE_MTRL") '(100 . "AcDbPolyline") '(90 . 4) '(70 . 0) '(43 . 0.0) '(38 . 0.0) '(39 . 0.0) '(10 0.0 -9.6) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) '(91 . 0) '(10 0.0 -19.2) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) '(91 . 0) '(10 104.981 -19.2) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) '(91 . 0) '(10 104.981 -9.6) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) '(91 . 0) '(210 0.0 0.0 1.0)))
    (entmake (list '(0 . "LINE") '(100 . "AcDbEntity") '(67 . 1) '(8 . "TABLE_MTRL") '(100 . "AcDbLine") '(10 6.8 -9.6 0.0) '(11 6.8 -19.2 0.0) '(210 0.0 0.0 1.0)))
    (entmake (list '(0 . "LINE") '(100 . "AcDbEntity") '(67 . 1) '(8 . "TABLE_MTRL") '(100 . "AcDbLine") '(10 24.0 -9.6 0.0) '(11 24.0 -19.2 0.0) '(210 0.0 0.0 1.0)))
    (entmake (list '(0 . "ATTDEF") '(100 . "AcDbEntity") '(67 . 1) '(8 . "TABLE_MTRL") '(100 . "AcDbText") '(10 1.68571 -15.4 0.0) '(40 . 2.0) '(1 . "1") '(50 . 0.0) '(41 . 0.8) '(51 . 0.0) '(7 . "Text_MTRL") '(71 . 0) '(72 . 1) '(11 3.4 -14.4 0.0) '(210 0.0 0.0 1.0) '(100 . "AcDbAttributeDefinition") '(280 . 0) '(3 . "Material Number") '(2 . "NO") '(70 . 0) '(73 . 0) '(74 . 2) '(280 . 1)))
    (entmake (list '(0 . "ATTDEF") '(100 . "AcDbEntity") '(67 . 1) '(8 . "TABLE_MTRL") '(100 . "AcDbText") '(10 13.1905 -15.4 0.0) '(40 . 2.0) '(1 . "0") '(50 . 0.0) '(41 . 0.8) '(51 . 0.0) '(7 . "Text_MTRL") '(71 . 0) '(72 . 1) '(11 15.4 -14.4 0.0) '(210 0.0 0.0 1.0) '(100 . "AcDbAttributeDefinition") '(280 . 0) '(3 . "QUANTITY") '(2 . "QTY") '(70 . 0) '(73 . 0) '(74 . 2) '(280 . 1)))
    (entmake (list '(0 . "ATTDEF") '(100 . "AcDbEntity") '(67 . 1) '(8 . "TABLE_MTRL") '(100 . "AcDbText") '(10 26.4 -15.4 0.0) '(40 . 2.0) '(1 . "") '(50 . 0.0) '(41 . 0.8) '(51 . 0.0) '(7 . "Text_MTRL") '(71 . 0) '(72 . 0) '(11 26.4 -14.4 0.0) '(210 0.0 0.0 1.0) '(100 . "AcDbAttributeDefinition") '(280 . 0) '(3 . "DESCRIPTION") '(2 . "DESC") '(70 . 0) '(73 . 0) '(74 . 2) '(280 . 1) '(71 . 4) '(72 . 0) '(11 26.4 -14.4 0.0) '(101 . "Embedded Object") '(10 26.4 -14.4 0.0) '(40 . 2.0) '(41 . 76.0) '(46 . 0.0) '(71 . 4) '(72 . 5) '(1 . "\\W0.8000;") '(7 . "Text_MTRL") '(210 0.0 0.0 1.0) '(11 1.0 0.0 0.0) '(42 . 0.0) '(43 . 0.0) '(50 . 0.0) '(73 . 1) '(44 . 1.0)))
    (entmake (list '(0 . "ENDBLK") '(100 . "AcDbEntity")  '(8 . "0") '(100 . "AcDbBlockEnd")))
    )

     

    I found that if I entmake the block insert with a regular attribute, it "works" with the stipulation that I have to run BATTMAN (or other method) to update the insert. Only then does the attribute change to multi-line. I would prefer to make it directly, that is the DXF code I'm trying to figure out.

     

    THANX.....

    Please use plain text.