Visual LISP, AutoLISP and General Customization
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
script file - how to write
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
174 Views, 3 Replies
07-21-2005 12:50 PM
where do you go to learn about using and writing script files to create layers with linetypes and colors you want.
Re: script file - how to write
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-21-2005 01:36 PM in reply to:
sbsmith
Search this group on "layers." A lot of different approaches to this have been discussed in great detail already.
Probably the simplest non-programming approach is to use the built-in layer states capability. Create a drawing with layers the way you want, then export its layer state to a file. Then you can import that layer state into any other drawing.
Probably the simplest non-programming approach is to use the built-in layer states capability. Create a drawing with layers the way you want, then export its layer state to a file. Then you can import that layer state into any other drawing.
Re: script file - how to write
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-21-2005 03:44 PM in reply to:
sbsmith
It's really simple...Fire up Notepad and type your commands. Each line represents an entry into the command prompt. So however you would type out the entire command is how you would write the script file. There needs to be a blank line at the end, otherwise the last entry won't be entered. For example:
-layer
new
NewLayerName
(blank line here)
Save the file with a .scr extension, and you're good to go!
Now to take it a step further, you can use spaces to represent a return, otherwise script files can become quite lengthy...Here's the same script file, condensed to a single line
-layer new NewLayerName
There are TWO spaces after "NewLayerName." There are two because the first space is a return to input "NewLayerName" into the layer command. The second is to exit out of the layer command's main menu. There is no blank line, because we now used a space instead. So now you can group each command sequence into a single line for each command. Easier to maintain. For example:
-layer make NewLayerName
line 0,0 @12<45
ONE space now after the layer command, because the return to the next line for the Line command is the return. TWO spaces after the line command, first one to input "@12<45" and the second one to end the line command. NO blank lines at the end.
Hope that shed some light on the subject...
-layer
new
NewLayerName
(blank line here)
Save the file with a .scr extension, and you're good to go!
Now to take it a step further, you can use spaces to represent a return, otherwise script files can become quite lengthy...Here's the same script file, condensed to a single line
-layer new NewLayerName
There are TWO spaces after "NewLayerName." There are two because the first space is a return to input "NewLayerName" into the layer command. The second is to exit out of the layer command's main menu. There is no blank line, because we now used a space instead. So now you can group each command sequence into a single line for each command. Easier to maintain. For example:
-layer make NewLayerName
line 0,0 @12<45
ONE space now after the layer command, because the return to the next line for the Line command is the return. TWO spaces after the line command, first one to input "@12<45" and the second one to end the line command. NO blank lines at the end.
Hope that shed some light on the subject...
*David McReynolds
Re: script file - how to write
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-21-2005 04:40 PM in reply to:
sbsmith
Lisp Version
;;;;---------------------------------------------- ---------------------
(setq c (tblsearch "ltype" "HWC2"))
(if (= c nill)
(progn
(command "-LINETYPE" "Load" "HWC2" "hbhu.lin" "")
)
)
(if (/= c nil)
(progn
(prompt " HWC2 already loaded ")
(terpri)
)
)
;;;;---------------------------------------------- ---------------------
(setq d (tblsearch "ltype" "CENTER2"))
(if (= d nil)
(progn
(command "-LINETYPE" "Load" "CENTER2" "acad.lin" "")
)
)
(if (/= d nil)
(progn
(prompt " CENTER2 already loaded ")
(terpri)
)
)
Script Version
-layer Make M-LET C 3 M-LET l continuous M-LET
-layer Make Mview OFF Y Mview
-layer Make RMNO C 4 RMNO L CONTINUOUS RMNO
-layer Make xref C 7 xref L CONTINUOUS xref lock xref
-layer Make P-CW C 5 P-CW L CENTER P-CW
-layer Make P-HW C 1 P-HW L PHANTOM P-HW
-layer Make P-HWC C 1 P-HWC L HWC P-HWC
-layer Make P-VENT C 6 P-VENT L DASHED P-VENT
-layer Make P-WASTE C 1 P-WASTE L CONTINUOUS P-WASTE
-layer Make P-GAS C 6 P-GAS L CONTINUOUS P-GAS
-layer Make P-MGAS C 6 P-MGAS L CONTINUOUS P-MGAS
wrote in message news:4908114@discussion.autodesk.com...
where do you go to learn about using and writing script files to create
layers with linetypes and colors you want.
;;;;----------------------------------------------
(setq c (tblsearch "ltype" "HWC2"))
(if (= c nill)
(progn
(command "-LINETYPE" "Load" "HWC2" "hbhu.lin" "")
)
)
(if (/= c nil)
(progn
(prompt " HWC2 already loaded ")
(terpri)
)
)
;;;;----------------------------------------------
(setq d (tblsearch "ltype" "CENTER2"))
(if (= d nil)
(progn
(command "-LINETYPE" "Load" "CENTER2" "acad.lin" "")
)
)
(if (/= d nil)
(progn
(prompt " CENTER2 already loaded ")
(terpri)
)
)
Script Version
-layer Make M-LET C 3 M-LET l continuous M-LET
-layer Make Mview OFF Y Mview
-layer Make RMNO C 4 RMNO L CONTINUOUS RMNO
-layer Make xref C 7 xref L CONTINUOUS xref lock xref
-layer Make P-CW C 5 P-CW L CENTER P-CW
-layer Make P-HW C 1 P-HW L PHANTOM P-HW
-layer Make P-HWC C 1 P-HWC L HWC P-HWC
-layer Make P-VENT C 6 P-VENT L DASHED P-VENT
-layer Make P-WASTE C 1 P-WASTE L CONTINUOUS P-WASTE
-layer Make P-GAS C 6 P-GAS L CONTINUOUS P-GAS
-layer Make P-MGAS C 6 P-MGAS L CONTINUOUS P-MGAS
where do you go to learn about using and writing script files to create
layers with linetypes and colors you want.

