Passing array of objects to Plugin Execute() method instead of array of strings

Passing array of objects to Plugin Execute() method instead of array of strings

HusseinOthman75
Enthusiast Enthusiast
1,573件の閲覧回数
7件の返信
メッセージ1/8

Passing array of objects to Plugin Execute() method instead of array of strings

HusseinOthman75
Enthusiast
Enthusiast

A very crucial thing when using Navisworks plugin through C# Application (in my case) is the parameters passed from application to the plugin through calling Execute() method which is array of strings. The array of strings represents a bottleneck which limit the power of using Navisworks. For example with array of strings i can pass only the name of items to be selected in navisworks, but with passing array of objects i can pass the name, status, priority, ..... etc. for each array item, which give much pawer manipulating navisworks items : for example i can select items by name where status="Done" or Priority=1 or ..... etc. Is this option available? if not could we raise this substencial issue to Navisworks development team. Regards

0 件のいいね
解決済み
1,574件の閲覧回数
7件の返信
返信 (7)
メッセージ2/8

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @HusseinOthman75 ,

 

A string can be JSON that you deserialize to obtain the desired data.

If this doesn't help, please let me know.

I will submit an improvement ticket for this issue.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

メッセージ3/8

HusseinOthman75
Enthusiast
Enthusiast

Hi Naveen,

Thank you for your answer. Can you please drive an example , passing data to plug in as Json,

Regards

0 件のいいね
メッセージ4/8

HusseinOthman75
Enthusiast
Enthusiast

Hi Naveen,

Thank you for your answer. Can you please drive an example , passing data to plug in as Json,

Regards

0 件のいいね
メッセージ5/8

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @HusseinOthman75 ,

 

Please take a look at the attached files for the sample code. Here is the sample code to access an array of object data located in "Test" inside "Navisworks_2023"


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

メッセージ6/8

HusseinOthman75
Enthusiast
Enthusiast

Hi Naveen,
Thank you very much for your help, highly appreciated. i applied the logic in your example but i recieve the following error :

nw.png

Note : This is a C# application. InvokeNavisworksPlugInTestPack1() method runs NavisworksApplication and Append

the the required model. then i invoke the plugin and pass the JSON string as shown. I tried to resolve this error

but to no avail. 

Thanks agin for you help.

0 件のいいね
メッセージ7/8

naveen.kumar.t
Autodesk Support
Autodesk Support
解決済み

Hi @HusseinOthman75 ,

 

I cannot replicate the issue on my end.

The attached sample code functions properly on my end.

Kindly refer to the attached files.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

メッセージ8/8

HusseinOthman75
Enthusiast
Enthusiast
Hi naveen,
Thanks you for your technical support. The issue is resolved and your solution works perfectly
Regards
0 件のいいね