N_461 Posted November 1, 2010 Share Posted November 1, 2010 Hey Lee, I had one of my Jr. guys populate this. Im getting an "Error: malformed string on input" msg come up. initially i though it had something to do with the layer descriptions- so I nil all them but still get error. Cn you see where? I've hunted and can't see anything that would cause. any clue? (defun MakeLayer ( name colour linetype lineweight willplot bitflag description ) ;; © Lee Mac 2010 (or (tblsearch "LAYER" name) (entmake (append (list (cons 0 "LAYER") (cons 100 "AcDbSymbolTableRecord") (cons 100 "AcDbLayerTableRecord") (cons 2 name) (cons 70 bitflag) (cons 290 (if willplot 1 0)) (cons 6 (if (and linetype (tblsearch "LTYPE" linetype)) linetype "CONTINUOUS" ) ) (cons 62 (if (and colour (< 0 (abs colour) 256)) colour 7)) (cons 370 (fix (* 100 (if (and lineweight (<= 0.0 lineweight 2.11)) lineweight 0.0) ) ) ) ) (if description (list (list -3 (list "AcAecLayerStandard" (cons 1000 "") (cons 1000 description)) ) ) ) ) ) ) ) (defun c:MakeLayers nil ;; © Lee Mac 2010 ;; Specifications: ;; Description Data Type Remarks ;; ----------------------------------------------------------------- ;; Layer Name STRING Only standard chars allowed ;; Layer Colour INTEGER may be nil, -ve for Layer Off, Colour < 256 ;; Layer Linetype STRING may be nil, If not loaded, CONTINUOUS. ;; Layer Lineweight REAL may be nil, 0 <= x <= 2.11 ;; Plot? BOOLEAN T = Plot Layer, nil otherwise ;; Bit Flag INTEGER 0=None, 1=Frozen, 2=Frozen in VP, 4=Locked ;; Description STRING may be nil for no description ;; Function will return list detailing whether layer creation is successful. ( (lambda ( lst ) (mapcar 'cons (mapcar 'car lst) (mapcar (function (lambda ( x ) (apply 'MakeLayer x) ) ) lst ) ) ) '( ; Name Colour Linetype Lineweight Plot? BitFlag Description ( "BUILDING" 5 nil 0.18 T 0 nil ) ( "BOM" 2 nil 0.18 T 0 nil ) ( "Border" 7 nil 0.18 T 0 nil ) ( "CABLE" 3 "CABLE_LINE" 0.18 T 0 nil ) ( "CENTER" 6 "CENTER" 0.18 T 0 nil ) ( "CLOUD" 7 nil 0.18 T 0 nil ) ( "CONSTRUCTION" 4 nil 0.18 nil 0 nil ) ( "Defpoints" 7 nil 0.18 T 0 nil ) ( "Dim1" 1 "continuous" 0.18 T 0 nil ) ( "ENGNOTE" 33 nil 0.18 T 1 nil ) ( "ENGSTAMP" 2 nil 0.18 T 0 nil ) ( "Equip" 5 nil 0.18 T 0 nil ) ( "Exist" 33 nil 0.18 T 0 nil ) ( "FENCE" 3 "FENCELINE3" 0.18 T 0 nil ) ( "FUTURE" 8 "PHANTOM" 0.18 T 0 nil ) ( "Graph" 6 nil 0.18 T 0 nil ) ( "GRID" 1 DOT 0.18 T 0 nil ) ( "HVAC" 120 nil 0.18 T 0 nil ) ( "LEASE 33 "PHANTOM" 0.18 T 0 nil ) ( "PILES" 2 nil 0.18 T 0 nil ) ( "PIPE AG" 6 nil 0.18 T 0 nil ) ( "PIPE UG" 6 "HIDDEN" 0.18 T 0 nil ) ( "POWERLINE" 3 "POWER_LINE" 0.18 T 0 nil ) ( "RAILROAD" 3 nil 0.18 T 0 nil ) ( "ROAD" 33 nil 0.18 T 0 nil ) ( "ROW" 3 nil 0.18 T 0 nil ) ( "SKID" 33 "PHANTOM" 0.18 T 0 nil ) ( "Steel" 11 nil 0.18 T 0 nil ) ( "SURVEY" 6 nil 0.18 T 0 nil ) ( "SYMBOL" 1 nil 0.18 T 0 nil ) ( "Telephone" 3 "TELE_LINE" 0.18 T 0 nil ) ( "Text" 2 nil 0.18 T 0 nil ) ( "Top_Worx" 3 nil 0.18 T 0 nil ) ( "Viewl" 2 nil 0.00 nil 0 nil ) ( "Water" 3 "WATER_LINE" 0.18 T 0 nil ) ) ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted November 1, 2010 Share Posted November 1, 2010 Hint: LEASE... also Linetype DOT Another Hint: I could spot it instantly, because the VLIDE has syntax highlighting... Quote Link to comment Share on other sites More sharing options...
N_461 Posted November 1, 2010 Share Posted November 1, 2010 BEAUTY, THANKS MAN! I CANT BELEIVE I MISSED THAT. Yah I really need to learn the basics of VILDE. Im sure theres a VLIDE For Dummies kicking around..... Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted November 1, 2010 Share Posted November 1, 2010 BEAUTY, THANKS MAN! I CANT BELEIVE I MISSED THAT. Yah I really need to learn the basics of VILDE. Im sure theres a VLIDE For Dummies kicking around..... No worries Regarding VLIDE: its not too difficult - even if you just use it for the syntax highlighting. Quick Start Guide: Open AutoCAD, Type VLIDE at the command line, Go to File > New File (or Ctrl+N), Paste the code from your above post and you will immediately see the mistake Quote Link to comment Share on other sites More sharing options...
N_461 Posted December 2, 2010 Share Posted December 2, 2010 Hey Lee, sorry i got super busy at work- just wanted to say thanks and i'll be studying your website- will be a great resource! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 2, 2010 Share Posted December 2, 2010 Hey Lee, sorry i got super busy at work- just wanted to say thanks and i'll be studying your website- will be a great resource! No worries mate - happy to help 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.