.NET

Reply
Distinguished Contributor
VB_Autocad_guy
Posts: 136
Registered: ‎07-24-2009
Message 1 of 3 (121 Views)

Linetype - How to catch errors

121 Views, 2 Replies
02-08-2012 10:35 AM

When I load the linetype file

 

'' Load the Center Linetype
acCurDb.LoadLineTypeFile(sLineTypeName, gstrc_SFR_LineType_FullFileName)

 

How do I detect if the linetype is in the Linetype file? How do I do my error checking here in the ACAD way? 

 

Currently I just search the acad.lin or sfr.lin Text File to see if the LineType Exists. This works.

 

But I was curious how would you check the linetype file via the Acad API,

to see if the linetype definition name exists in the file? 

 

 

 

 

 

 

*Expert Elite*
dgorsman
Posts: 4,710
Registered: ‎10-12-2006
Message 2 of 3 (104 Views)

Re: Linetype - How to catch errors

02-08-2012 03:00 PM in reply to: VB_Autocad_guy

Try/catch, resorting to the CONTINUOUS linetype hard-coded into AutoCAD in the event an error is thrown.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
Adopt. Adapt. Overcome. Or be overcome.
A good question will be halfway to a good answer.


Valued Contributor
FFlix
Posts: 95
Registered: ‎11-15-2011
Message 3 of 3 (93 Views)

Re: Linetype - How to catch errors

02-09-2012 07:47 AM in reply to: VB_Autocad_guy

or, with reference to the example from the developers guide, open the linetypetable and check whether linetypetable.has(linetype). in addition to reverting to any particular linetype - which may be perfectly fine - you can check for alternative linetypes and/or load a particular linetype file.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community