Hi,
I am unsure, although is there a potential way to get each object unique refernece ID that is in navisworks to via the API?
E.g I have 3 objects called "Door", I would like to be able to tell the difference from each object.
Cheers,
Marc C
Solved! Go to Solution.
Solved by xiaodong_liang. Go to Solution.
Solved by Khez. Go to Solution.
Objects have certain categories of properties assigned by default in Navisworks, accessible via the properties panel (Shift+F7).
If you look in the Item tab of the properties panel, there's a property called "GUID", witch is a unique identifier.
Now properties only show in the panel when you have stuff selected, but you can totally find an item programatically (via the search method), store it in a ModelItem type and get the guid property.
this is what you would do for a selected item:
Document oDoc = Autodesk.Navisworks.Api.Application.ActiveDocument; //get only the first selected object ModelItem oSelectedItem = oDoc.CurrentSelection.SelectedItems.ElementAt<ModelItem>(0); //search for a specific data property(GUID) in a specific property category(Item) DataProperty elemProp = oSelectedItem.PropertyCategories.FindPropertyByDisplayName("Item","GUID"); // Getting the value it is a variantData type of value, so I convert to displaystring before using ToString(), otherwise it will get something like this : "DisplayString:**********" string elemGUID = elemProp.Value.ToDisplayString().ToString();
That was just for the GUID, but if you want to learn more about properties, I suggest Reading this arcticle: Navisworks .NET API Properties
Hi Khez,
fantastic answer, thank you. I am just a little unsure were you are refering to GUID. I do not seem to have that property available to see? I may be-able to capture it programitcally, this is I have yet to test.
These are the properties I get when I select an item.
I do see a handle within the "Entity Handle" tab although I am not sure this is what you are referring to, could you offer any more information incase I am missing a property option to display this?
Cheers,
Marc
Hi Marc,
The file from different CAD format would have different attribute to identify the entity. Entity Handle is for DWG file. It can be used to identify the object.
http://adndevblog.typepad.com/aec/2012/06/persistent-item-id-of-navisworks-objects.html
Can't find what you're looking for? Ask the community or share your knowledge.