A complex example
Creates a shp file of the shape for a complex linetype
Compile this file
Creates the linetype .lin model
Makes the linetype table
Load this type of line into the current drawing
Linetype is available in the drawing
((lambda ( / f_shp f_lin doc)
(if (not (findfile "rond_plein.shp"))
(progn
(setq f_shp (open (strcat (getvar "ROAMABLEROOTPREFIX") "support\\rond_plein.shp") "w"))
(write-line "*128,66,RONDPLEIN" f_shp)
(write-line "2,3,10,010,1,10,(1,000),2,010,1,10,(2,000),2,010,1,10,(3,000),2,010,1,10," f_shp)
(write-line "(4,000),2,010,1,10,(5,000),2,010,1,10,(6,000),2,010,1,10,(7,000),2,010,1,10," f_shp)
(write-line "(8,000),2,010,1,10,(9,000),2,010,1,10,(10,000),2,3,10,0" f_shp)
(close f_shp)
)
)
(command "_.compile" (strcat (getvar "ROAMABLEROOTPREFIX") "support\\rond_plein.shp"))
(if (not (tblsearch "STYLE" ""))
(entmakex
'(
(0 . "STYLE")
(100 . "AcDbSymbolTableRecord")
(100 . "AcDbTextStyleTableRecord")
(2 . "")
(70 . 1)
(40 . 0.0)
(41 . 1.0)
(50 . 0.0)
(71 . 0)
(42 . 2.5)
(3 . "rond_plein.shx")
(4 . "")
)
)
)
(entmake
(list
'(0 . "LTYPE")
'(100 . "AcDbSymbolTableRecord")
'(100 . "AcDbLinetypeTableRecord")
'(2 . "DotsLine")
'(70 . 0)
'(3 . "pointillé shx . . . .")
'(72 . 65)
'(73 . 2)
'(40 . 1.0)
'(49 . 1.0)
'(74 . 4)
'(75 . 128)
(CONS 340 (TBLOBJNAME "STYLE" ""))
'(46 . 0.1)
'(50 . 0.0)
'(44 . 0.0)
'(45 . 0.0)
'(49 . 0.0)
'(74 . 0)
)
)
(if (not (findfile "DotsLine.lin"))
(progn
(setq f_lin (open (strcat (getvar "ROAMABLEROOTPREFIX") "support\\DotsLine.lin") "w"))
(write-line "*DotsLine,cloture shx . . . ." f_lin)
(write-line "A,1,[RONDPLEIN,rond_plein.shx,x=0,s=.1],0" f_lin)
(close f_lin)
)
)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(if
(and
(not
(vlax-for item (vla-get-linetypes doc)
(if (= (strcase (vla-get-name item)) (strcase "DotsLine")) T)
)
)
(vl-catch-all-error-p
(vl-catch-all-apply
'vla-load
(list (vla-get-Linetypes doc) "DotsLine" "DotsLine.lin")
)
)
)
nil
T
)
(princ "\nCréation de Type de Ligne \"DotsLine\" effectué!")
(prin1)
))