Loading linetypes and font files automatically

Loading linetypes and font files automatically

ameyaparsodkar
Contributor Contributor
3,192 Views
9 Replies
Message 1 of 10

Loading linetypes and font files automatically

ameyaparsodkar
Contributor
Contributor

Hi,

I am working on a partial cui file for making layers menu tab in Menubar. See Image below:

 

CUI.png

I have written a macro for each of the layers, see sample macro for Centerline:

ID_CAD 31 [Centreline]^C^C-Layer;m;T-------C3N;c;4;;L;CENTRUMLINJE;;Lw;0.18;;d;Centrumlinje / Vagmitt;;;;

I have number of layers with different linetypes. Each time i open a new file i have to load all the linetypes. If i don't load the linetypes the macro gives me an error.

I wish to send this CUI file to client and not necessarily the client will have the linetypes that i have. I don't want him to do all stuff of loading the linetypes and fonts for using this CUI.

Is there any way to load all the linetypes and fonts automatically without copying those in the 'Support' folder in AutoCAD? 

3,193 Views
9 Replies
Replies (9)
Message 2 of 10

Moshe-A
Mentor
Mentor

@ameyaparsodkar  hi,

 

include (with the cuix) your lin + shx files. the client have to copy these files to support folder once (if you don't make more changes to them).

 

moshe

 

0 Likes
Message 3 of 10

Kent1Cooper
Consultant
Consultant

If you put those linetype definitions into the acad.lin file, rather than [or in addition to] having them in other files, you won't need to load them if you are giving a linetype assignment in a command-line-macro LAYER command, or a linetype property override in a CHPROP command or the Properties option in a CHANGE command.  Those commands can find them if they're in acad.lin, without their being pre-loaded.

 

You would  need to load them first if you use them in certain other ways, such as to give an object a linetype override in an (entmake) operation or to change a linetype in entity data with (subst)/(entmod) operations.

Kent Cooper, AIA
0 Likes
Message 4 of 10

ameyaparsodkar
Contributor
Contributor

Yes agree with you. I can put the linetypes in acad.lin file.  But when i send the  .CUI file to client he will have to do the same thing that I did to make the cui/Linetype work i.e copy all the new linetypes in acad.lin file or I will have to send my modified acad.lin which i want to avoid as i don't want him to do any adjustments once the CUI file is delivered.

 

Hope you understood what i want?

 

Thanks,

Ameya

0 Likes
Message 5 of 10

DannyNL
Advisor
Advisor

Out of curiosity; why create a pull down menu?

 

If you create a toolpalette, the linetypes are embedded and you'll only need to distribute the toolpalette files. The only thing the receiving party has to do is include the path to your toolpalettes in the AutoCAD profile and they are good to go.

0 Likes
Message 6 of 10

scot-65
Advisor
Advisor
Perhaps a DWT with all the loaded layers and linetypes?
(if (not (tblsearch "LTYPE" "MyLinetype"))
(progn
(command-s "-Insert" "MyDrawing.DWT" (getvar 'VIEWCTR) "" "" "")
(command-s "Erase" (entlast) "")
);progn
);if

Hatches are a different story...

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 7 of 10

ameyaparsodkar
Contributor
Contributor

Hi,

May be i was not clear. The drop down is not for a linetype, but it is for a layer. For eg: If i choose  to draw a Centerline, i want the Centerline layer with its standard Name, Linetype, Color and Description to be created and automatically set to current layer. I have 1800+ layers and I intend to create a library for it using Macro/as a menu tab in Menu bar.

0 Likes
Message 8 of 10

ameyaparsodkar
Contributor
Contributor

Hi,

I have hundreds of people who will be using Layers Menu tab on clients side and i cant tell everyone to load the linetype file or to follow the Template file. Every one has a different working method so i want to be sure that they will not face a problem even if they don't use a template file.

Is there something in the CUI macro itself by which we can create linetype with some coding?

0 Likes
Message 9 of 10

DannyNL
Advisor
Advisor

Yes, I did understand your request, but I think you underestimate the out of the box power and versatility of toolpalettes. What you want is also possible with the toolpalettes.

 

First, the macro you are using could also be incorporated in a toolpalette, so there is no difference there except the different interaction with the user. Secondly, you actually do not need a macro as you can build tools directly with the right properties. The only one thing that will be missing will be the description in the layer definition, as this does not seem to be copied into the toolpalette.
So 100% perfect? Maybe not, but it will save you the trouble of creating/modifying linetype libraries.

 

There are multiple ways here to achieve what you want, but including your linetype in the CUI is not one of them for as far as I know.

So your options are:

- Separate linetype library: doesn't need a modification in the default linetype library for whoever needs to work with this, but you'll need to include the loading of the linetypes in your macro. Linetype library needs to be in the current folder or in one of the folders of the search paths.

- Use a DWT/DWG/DWS a a library for your linetypes (and layers) and use LISP (DBX) to copy the definitions into your current drawing. Library drawing needs to be in the current folder or in one of the folders of the search paths.

- - Use a toolpalette; linetype and layer definitions are embedded, but the layer description is missing. Toolpalette path needs to be added to the current profile.

0 Likes
Message 10 of 10

john.uhden
Mentor
Mentor

Linetypes are easy.  (command ".ltype" "_L" "*" <whatever.lin>) and the linetype definition is in the drawing.

But fonts are different.  They are not loaded into the drawing but are referenced only, be it in a style definition or as an override to a text object's property.  Good luck with that.  I think you would have to have a file such as Land Desktop used to define separate text styles, each having perhaps separate fonts, plus an AutoLisp function to read the file and perform the style definition.  But you probably don't need a gazillion styles, unless that's what you mean by "font."

John F. Uhden

0 Likes