.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Copy Linetype from Another Database

8 REPLIES 8
Reply
Message 1 of 9
Techno Destructo
672 Views, 8 Replies

Copy Linetype from Another Database

Here is my situation:
I have 1 drawing open, I have another drawings Database open
I have found the LinetypeTableRecord (in the Database) of the line type I want to copy to the open drawing.

The Question:
How do I copy a LinetypeTableRecord from one drawing to another?
any examples would be helpfull.
8 REPLIES 8
Message 2 of 9

Ok, here's the track I am on now. Im not sure its the right track mind you!

I think I have to use DeepClone, so here is what I tried:

Database db = HostApplicationServices.WorkingDatabse;

ObjectIdCollection vObjs = newObjectIdCollection();
vObjs(0) = Object Id of linetype I want to copy

db.DeepCloneObjects(vObjs,?????,false);

Now IF I am on the right track what goes where the ????? are?
The help says ObjectId is required there but ID of what? The LineTypeTable? (I tried that and it didn't work).
Message 3 of 9
Anonymous
in reply to: Techno Destructo

db.WblockCloneObjects(...)
Message 4 of 9
ilya.s.solovyev
in reply to: Anonymous

I am using Database.WblockCloneObjects() to copy linetypes from external drawing. It works fine if linetype doesn't have a reference to complied shape file (.shx). If it does, linetypes are copied without shape-referenced part (e.g. geometries like rounds).

 

Is there any solution?

Message 5 of 9

Is there a reason why you can't just use LoadLinetype()?

 

http://through-the-interface.typepad.com/through_the_interface/2010/03/loading-multiple-linetypes-in...




Fenton Webb
AutoCAD Engineering
Autodesk

Message 6 of 9

Yes, I am using drawing templates to load all the stuff for my current drawing.
Actually, now I have switched to loading line types from file, but it'd be good for me to load from *.dwt.
Message 7 of 9

Just use Database.Insert("dwtFile.dwt",,,)




Fenton Webb
AutoCAD Engineering
Autodesk

Message 8 of 9

Are you shure about this?

 

There are three overloads and only two of them accept string parameters, which are blockName from another database, as I understand:

public void Insert(Matrix3d transform, Database dataBase, bool preserveSourceDatabase);
public ObjectId Insert(string blockName, Database dataBase, bool preserveSourceDatabase);
public ObjectId Insert(string sourceBlockName, string destinationBlockName, Database dataBase, bool preserveSourceDatabase);

Message 9 of 9

Something like this http://forums.augi.com/showthread.php?145986-Insert-External-DWG-file-with-attributes




Fenton Webb
AutoCAD Engineering
Autodesk

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost