View Full Version : Loading Linetypes from a Script
AutoTAD
2004-08-24, 12:37 PM
I'm "drawing" a total blank on this and I am pretty sure I've done it before.
I want to make a script file that will load my custom linetypes into a drawing. I would also like the linetype file to have a unique file name. How do I tell AutoCAD what file to load the linetypes from?
-linetype
load
capillary
Thanks,
-autoTAD
Cintas Corporation
mjfarrell
2004-08-24, 12:58 PM
The first lines of your script should be
filedia
0
cmddia
0
-linetype
l
"Your path to the LIN file you want" (note quotes are needed)
* then add this to the end if you do anything
*after the line above
filedia
1
cmddia
1
Enjoy! :beer:
AutoTAD
2004-08-24, 01:14 PM
Thanks for your help. But I think I'm missing something here...
filedia
0
cmddia
0
-linetype
load
"c:\_CAD\process_lt\process_lt.lin"*
filedia
1
cmddia
1
Thoughts?
-autoTAD
AutoTAD
2004-08-24, 01:19 PM
ah hah! never mind I got it now.
filedia
0
cmddia
0
-linetype
load
*
"\path\filename.lin"
filedia
1
cmddia
1
Thanks for your help!
-autoTAD
Cintas Corporation
mjfarrell
2004-08-24, 01:21 PM
Thanks for your help. But I think I'm missing something here...
filedia
0
cmddia
0
-linetype
load
"c:\_CAD\process_lt\process_lt.lin"*
filedia
1
cmddia
1
Thoughts?
-autoTAD
I believe it is going to need to change _CAD and remove that *
or is that underscore actually part of the directory?
and add TWO returns befor the next instance of filedia.......
Mike.Perry
2004-08-24, 01:35 PM
Hi
Might want to take a look at the system variable EXPERT, will greatly help your script to be a little more robust -
<Script File Begins>
._FileDia
0
._CMdDia
0
(setq ExpertLvl (getvar "EXPERT"))(setvar "EXPERT" 3)
._-Linetype
_Load
*
"\path\filename.lin"
(setvar "EXPERT" ExpertLvl)
._FileDia
1
._CmdDia
1
<Script File Ends>
Have a good one, Mike
mjfarrell
2004-08-24, 02:00 PM
Mike,
I left the EXPERT variable out of the mix
as is my normal process when developing
a script.
I want to see any error messages that
might be encountered to help me prevent them if
possible without resorting to use of the EXPERT
settings.
richard.binning
2004-08-24, 02:33 PM
You might try something like the following to avoid hard coding in all the paths to the files.
(command "-Linetype" "l" "*" (findfile "acad.lin") "")
That'll load-em all in "one swell foop"!
Mike.Perry
2004-08-24, 02:37 PM
Mike,
I left the EXPERT variable out of the mix
as is my normal process when developing
a script.
I want to see any error messages that
might be encountered to help me prevent them if
possible without resorting to use of the EXPERT
settings.
Hi
So within a script file how do you get round the issue/problem of -
<snip>
Suppresses the preceding prompts and those issued by theLINETYPE command if you try to load a linetype that's already loaded or create a new linetype in a file that already defines that linetype.
</snip>
Setting system variable EXPERT = 3 gets round this.
I would like to see the method you employ within a script file so I may learn an alternative method.
Have a good one, Mike
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.