Get ImportInstance dwg name

Get ImportInstance dwg name

Dale.Bartlett
Collaborator Collaborator
1,228 Views
3 Replies
Message 1 of 4

Get ImportInstance dwg name

Dale.Bartlett
Collaborator
Collaborator

I am missing something obvious. I want to return the name of an Imported (not linked) DWG. The following is just not doing it for me...

foreach (ImportInstance ii in new FilteredElementCollector(pDoc)

.OfClass(typeof(ImportInstance))

.Cast<ImportInstance>()

.Where(i => i.IsLinked == false))

{

ElementId Id = ii.Id;

string name = ii.Name;

string tname = ii.GetType().Name;




______________
Yes, I'm Satoshi.
0 Likes
Accepted solutions (1)
1,229 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Accepted solution

Have you tried the 

ii.Category.Name property?

 

That returns the name in my application...

 

 

Message 3 of 4

Dale.Bartlett
Collaborator
Collaborator

The day is made when you learn one new thing...

Many thanks, Dale




______________
Yes, I'm Satoshi.
0 Likes
Message 4 of 4

rodrigohbm
Advocate
Advocate

Hello
There is way to get the path file

 

example:

 

c:\structural\sheet\102-floor 1 plant.dwg

 

and change path

 

c:\mep\structural\sheet\102-floor 1 plant.dwg

 

regards

0 Likes