Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Generate property list on document open in Navisworks Manage

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
upadhye.vinay
454 Views, 5 Replies

Generate property list on document open in Navisworks Manage

Hi,

I am try get list of the 3D model property to be used in our plugin. Currently, the list is getting created every time we call the plugin. Please suggest if it is possible to create the list of property when the document is opened and used the list in our plugin instead of creating the list on every plugin call.

 

Thanks,

Vinay

5 REPLIES 5
Message 2 of 6
alexisDVJML
in reply to: upadhye.vinay

@upadhye.vinay , just want to clarify 2 things

What you mean by 'on every plugin call'.

Do you want to:

  • 1.1/ create this list at every document opening and then use it during the session with this document?

OR (and I would guess this is your goal)

  • 1.2/ create the list the first time a document is open and reuse it in between session?

What you mean by 'list of the 3D model property':

2.1 List of categories/properties names? or

2.2 List of all properties with their values. I will cover

NOTE: Below I cover only:
- the case of .NWD files and consider them readonly. 
.NWF support user categories/properties and are inherently read/write so an approach different than what I described below is required.
- the case 2.1

 

In both cases 1.1 and 1.2, you will need to keep as a field of your plugin something like this

	public class CategoryDetails
	{
		public string mName;
		public List<string> mPropertiesNames;
	}

	private List<CategoryDetails> mCategoriesDetails;

NOTE:
- if you use lists, like above, you can build it ordered which will come handy
- alternatively you can use Dictionaries if you want to be able to do quick check for an existing category/property
- you can combine both List/Dictionary/HashSet, depending on your exact use cases

 

In case 1.1/ you build this at document opening and use it during the session.

 

In case 1.2/ you store this in a dedicated file, format up to you, JSON, XML, .INI, .csv, saved in the same folder as the .NWD with a name based on the .NWD file name, ex: "Xxx.nwd.categories.json".

 

When a document is open, you check if such file exists:

- if yes, just load it, done.
- else find all categories/properties names and create said file.

 

Hope this covers at least in part your question 😉

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go
Message 3 of 6
upadhye.vinay
in reply to: alexisDVJML

@alexisDVJML, Thanks for suggestions.
1. 'on every plugin call', I mean to say every time I click on my custom plugin in 'Tools-addins' tab of Navisworks manage.
2. As mention by you in 1.1, create this list at every document opening and then use it during the session with this document?
- This is what I want to achieve and list of the 3D model property will be the list of category and its associated name as mention in 2.1 by you. I am using dictionary to store this list.
can you suggest/guide me to create list of the 3D model property at every document opening and then use it during the session with this document.
Message 4 of 6
alexisDVJML
in reply to: upadhye.vinay

@upadhye.vinay , You can look at this thread:
https://forums.autodesk.com/t5/navisworks-api/list-all-of-the-categories-in-the-model/m-p/3620658#M6... 

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go
Message 5 of 6
upadhye.vinay
in reply to: alexisDVJML

@alexisDVJML. Thanks for the suggestion. we ended up using the second solution suggested by you of using json file to store the categories and property list.
Message 6 of 6
alexisDVJML
in reply to: upadhye.vinay

Great to hear you achieved expected results 👍

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report