Load LineTypes

Load LineTypes

C.Utzinger
Collaborator Collaborator
1,849 Views
3 Replies
Message 1 of 4

Load LineTypes

C.Utzinger
Collaborator
Collaborator

Hello

 

I have the following Macro:

 

^C^C-lt;_l;*;UT-BCAD-2016.lin;;;;;;;;;;;;;;;;;;;;;;;^C^C-layer;_m;-I-Gestrichelt;_co;1;-I-Gestrichelt;_l;25;-I-Gestrichelt;^Cltfaktor;100;plinie;

 

How you can see... I have a lot of "Enter" after loading the LIN File. That's because of the question if you want to substitute existing lines in the drawing. So there is a Enter for each line.

 

Is there a possibility to prevent this, or another way to do it?

 

I also would like to write a LISP file, but I have the same problem.

 

 

HELP???

Accepted solutions (1)
1,850 Views
3 Replies
Replies (3)
Message 2 of 4

ВeekeeCZ
Consultant
Consultant
Accepted solution

Set EXPERT variable to 3.

 

LISP: (setvar 'EXPERT 3) and then back to 0.

MACRO: EXPERT;3;

 

 

Sometime you'll will not have such solution... so other way could be

 

 

(if (tblsearch "LTYPE" "dashed2") ; if the line type is in the drawing
  (... "_y" ...)
  (...))

Or a general way...

 

(if (> (getvar 'CMDACTIVE) 0) ; is the command still active?
  (command "_Y"))
Message 3 of 4

Kent1Cooper
Consultant
Consultant

You can avoid having to load them entirely.

 

Make a just-in-case backup copy of ACAD.LIN under another name [I use ACADORIG.LIN].  Then add your other linetype definitions into ACAD.LIN.

 

In a Layer command's Linetype option, you can give it a linetype name that is not yet loaded into the drawing, and if that linetype is defined in ACAD.LIN, it will find it.  You do not need to load it first.

 

This is a big advantage of using (command "_.layer" "_make" ...), or a Layer command manually or in a macro, instead of the (entmake) approach to making a Layer, which will fail if the linetype is not loaded.

 

The same is true if you want to give a linetype override to an object.  If you use the command CHPROP [or CHANGE's Properties option], whether manually or in AutoLisp or a macro, and then the LType option, you can assign a linetype that is not yet loaded into the drawing, and again, if it's in ACAD.LIN, it will find it.  In contrast, other methods such as (subst)/(entmod) or (vla-put...) will fail if the linetype is not loaded.

Kent Cooper, AIA
Message 4 of 4

ad_sherratt
Contributor
Contributor

Thanks  for the 'EXPERT' tip. Lifesaver!

0 Likes