How to update custom linetype in Acad.lin

How to update custom linetype in Acad.lin

Anonymous
Not applicable
231 Views
0 Replies
Message 1 of 1

How to update custom linetype in Acad.lin

Anonymous
Not applicable

I am looking for the way to add a new linetype in Acad.lin . I am using this below command to load existing line types in drawing,but I need to modify the Acad.lin  and add a new lineType  Cross which looks like  -XXXXXXXX- through this command.

 

[CommandMethod("AttachLinetype")]
public static void LoadLinetype()
{
// Get the current document and database
Document acadDoc = Application.DocumentManager.MdiActiveDocument;
Database acadCurDb = acadDoc.Database;

// Start a transaction
using (Transaction acadTrans = acadCurDb.TransactionManager.StartTransaction())
{
// Open the Linetype table for read
LinetypeTable acLineTypTbl;

acLineTypTbl = acadTrans.GetObject(acadCurDb.LinetypeTableId, OpenMode.ForRead) as LinetypeTable;

// prompt receive the Layer name
PromptStringOptions pLineTypeName = new PromptStringOptions("\nEnter LineType name: ");
pLineTypeName.AllowSpaces = true;

PromptResult pLineTypeRes = acadDoc.Editor.GetString(pLineTypeName);

string sLineTypName = pLineTypeRes.StringResult;

// string = "Center";

if (acLineTypTbl.Has(sLineTypName) == false)
{
// Load the Center Linetype
acadCurDb.LoadLineTypeFile(sLineTypName, "acad.lin");
}

// Save the changes and dispose of the transaction
acadTrans.Commit();
}

 

Any help would be highly appreciated.Thanks in advance


}

0 Likes
232 Views
0 Replies
Replies (0)