AutoCAD/Visual Lisp

Advertisement


Question
Hello Sir,
would you please help me out to resolve an issue I have with creation complex ltypes using "entmake" function, or you know the other way to handle this?
Here is my simple code:
(entmake
    (list
        '(0 . "LTYPE")
        '(100 . "AcDbSymbolTableRecord")
        '(100 . "AcDbLinetypeTableRecord")
        '(2 . "FFP")
        '(70 . 0)
        '(3 . "FIRE_FEEDER_PIPING ---- FFP -------- FFP ------")
        '(72 . 65)
        '(73 . 3)
        '(40 . 2.81)
        '(49 . 2.16)
        '(74 . 0)
        '(49 . -0.2)
        '(74 . 0)
        '(74 . 2)
        '(75 . 0)
        (cons 340(tblobjname "STYLE" "Simplex"))
        '(46 . 0.2)
        '(50 . 0.0)
        '(44 . -0.1)
        '(45 . -0.09)
        '(9 . "FFP")
        '(49 . -0.45)
        '(74 . 0)
     );list
)
Before using, please create "Simplex" textstyle so that it could be incorporated in the code.
The point is that the code itself works and it does creates ltype but the embedded text is missing. Why?
I would apprecciate if you could resolve it.
Thank you!

Answer
You can't put text in a line like that.  
There are 2 ways I currently know how to do this:
1. Write a routine that puts in the line, breaks out a chunk, and puts in the text.
2. Create a custom linetype style. This is a royal pain, so I have rarely done this.. but it would result in a linetype you can use with any autocad entity, line, circle, pline, etc. The procedure is documented in the customization guide, so I won't repeat it here.

There may be a way to do this with some sort of custom entity object, but that's more complex than #2.
Scott

AutoCAD

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scott Cook

Expertise

I`ve been using AutoCAD since 1987 and programming AutoLISP nearly as long. I can answer questions about programming AutoCAD (except ARX) and production enhancement techniques. I cannot answer questions about AutoCAD crashes or DWG corruption. AutoCAD PROGRAMMING (menus, lisp) related questions only!

Experience

Since 1987. Author of Plot2000 software for for AutoCAD, http://www.plot2000.com. PROGRAMMING QUESTIONS ONLY PLEASE. Questions that are NOT related to programming or AutoCAD customization (menus and lisp only please) are outside the scope of my volunteer services and will NOT BE ANSWERED.

©2012 About.com, a part of The New York Times Company. All rights reserved.