sachindkini Posted December 7, 2009 Share Posted December 7, 2009 Creating Layers with all property (plot style, lw, discription, colour), dimension style & text style with AutoLisp Quote Link to comment Share on other sites More sharing options...
gile Posted December 7, 2009 Share Posted December 7, 2009 Hi, You can use entmake and specify properties in the dxf list (look at the developer's help > DXF Reference > TABLES Section > LAYER Here's an example which creates a layer named "VPORTS", color 8, unplotable (entmake (list '(0 . "LAYER") ; entity name '(100 . "AcDbSymbolTableRecord") ; class '(100 . "AcDbLayerTableRecord") ; sub class '(2 . "VPORT") ; name '(70 . 0) ; flag (frozen, locked, etc) '(62 . ; color '(6 . "Continuous") ; line type '(290 . 0) ; plotable '(370 . -3) ; line weight ) ) Quote Link to comment Share on other sites More sharing options...
MSasu Posted December 7, 2009 Share Posted December 7, 2009 Use TBLOBJNAME statement to see associated list of an existing layer as per example below: (entget (tblobjname "LAYER" TheLayerToList)) Then create a similar list with desired features and add the new layer record to database using ENTMAKE. Regards, Quote Link to comment Share on other sites More sharing options...
fixo Posted December 7, 2009 Share Posted December 7, 2009 Creating Layers with all property (plot style, lw, discription, colour), dimension style & text style with AutoLisp this will create layer with prperties and description (defun _make_layer (lname ltyp lwt col plot desc) (if (not (tblsearch "LAYER" lname)) ;layer name (progn (setq new_layer (vla-add (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) lname) ) ) ) (vla-put-description new_layer desc) ;description (vla-put-linetype new_layer (if (tblsearch "LTYPE" ltyp) ltyp ;linetype "Continuous")) (vlax-put new_layer 'Lineweight lwt) ;lineweight (vla-put-plottable new_layer (if plot :vlax-true :vlax-false)) ;plottable (setq accol (vla-getinterfaceobject (vlax-get-acad-object) (strcat "AutoCAD.AcCmColor." (itoa (atoi (getvar "acadver"))))) ) (vla-put-colorindex accol col) (vla-put-truecolor new_layer accol) ;color (vlax-release-object accol) ) ;;Usage: (vl-load-com) (defun C:DEMO () (_make_layer "NEW_LAYER" ;layer name "CENTER" ;linetype 50 ;lineweight 162 ;color T ;plottable "The layer description is goes here" ;description ) (princ) ) Quote Link to comment Share on other sites More sharing options...
sachindkini Posted December 8, 2009 Author Share Posted December 8, 2009 Dear Sir, Thx Quote Link to comment Share on other sites More sharing options...
MCADraft Posted December 9, 2011 Share Posted December 9, 2011 Can this be done with STB? ie include a "Plot Style" in the layer. At current all new layers are set with "normal" Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.