Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Distributing custom application and SearchCondition

Anonymous

Distributing custom application and SearchCondition

Anonymous
Not applicable

Our company has renewing license for Autodesk NavisWorks products. Currently we use 2009 and 2011 versions. I am developing our own .NET control which utilizes NavisWorks .NET control.
This control will be used in our own winform application and inside web browser as well (as a part or a web application).
Both applications (winforms and web application) will be distributed to our customer, who has NavisWorks license as well and installed on client (desktop) computers.
Therefore I need to solve the distribution problems.
1. Will I have to create (compile) two versions? One with 64b NavisWorks for 64b Win7 and one with 32b NavisWorks for 32b Win7?
2. Will I also have to create two versions, one with 2011 version and one with 2012 version?
The mentioned customer uses 2012 version.
3. The assembly is included in GAC, so I guess it is not necessary to bundle the library with the application.
If this is described somewhere, pointing me to it is just fine.
4. I struggle with the SearchCondition class and its usage to search for items. I have read a thread in this forum which helped me little (http://forums.autodesk.com/t5/Autodesk-Navisworks-API/Search-with-quot-OR-quot/td-p/3235364), but I still can not get the results.
   Is there a more detailed documentation than the one found in the installation directory of the Simulate program?
  
I will appreciate any help.

Martin Borkovec

0 Likes
Reply
976 Views
3 Replies
Replies (3)

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

1. Will I have to create (compile) two versions? One with 64b NavisWorks for 64b Win7 and one with 32b NavisWorks for 32b Win7?

  no, building with Any CPU should work


2. Will I also have to create two versions, one with 2011 version and one with 2012 version? The mentioned customer uses 2012 version.

  

As I know, .NET API is not binary compatible – you will need to rebuild your app with 2012 assemblies, particually if you want to use new features of 2012.


3. The assembly is included in GAC, so I guess it is not necessary to bundle the library with the application.
   

    yes, you do not need to bundle the library. .NET API requires the Navisworks Simulate/Manage installed.

 

4. I struggle with the SearchCondition class and its usage to search for items. I have read a thread in this forum which helped me little (http://forums.autodesk.com/t5/Autodesk-Navisworks-​API/Search-with-quot-OR-quot/td-p/3235364), but I still can not get the results.Is there a more detailed documentation than the one found in the installation directory of the Simulate program?

 

    I would suggest you post with a small sample, which is helpful to know what the problem is.

 

Regards,

Xiaodong Liang

Developer Technical Services

 

0 Likes

Anonymous
Not applicable

Thank you for your help.

 

The code I try to search for items is as follows:

Search mySearch = new Search();
mySearch.Selection.SelectAll();
SearchCondition myCondition = SearchCondition.HasPropertyByName("Item", "Name");
myCondition.EqualValue(VariantData.FromDisplayString("/1TZ10S26\\P"));
mySearch.SearchConditions.Add(myCondition);
ModelItemCollection mySearchResults = mySearch.FindAll(Autodesk.Navisworks.Api.Application.ActiveDocument, false);
foreach (ModelItem foundItem in mySearchResults) {
    myFoundItems.AppendLine(foundItem.DisplayName);
}

 

 I try to find an item with DisplayName (Node.UserName in COM API) /1TZ10S26\P as displayed in following picture. But the mySearchResults collection is empty.

nw01.png

 

Another question :

The custom .NET control that I have created (it uses the .NET NavisWorks control) is also to be used in a web browser

<object classid="http:CustomNwLib.dll#CustomNwLib.CustomNavisCtl" width="640" height="400" id="nwCtl">
</object> 

 It shows properly but if I click inside the NavisWorks control area (the black rectangle), IE freezes. Do you have any information regarding this issue, or have you heard of someone else using succesfully the .NET control in IE?

 

Best regards

 

Martin Borkovec

0 Likes

xiaodong_liang
Autodesk Support
Autodesk Support

About .NET control in web, the only I am aware is: we have longer term plans to look at use in the web.

 

"Item" and "Name" are display names. you should use SearchCondition.HasPropertyByDisplayName ("Item", "Name");

 

Each PropertyCategory or Property has an internal name and a display name. From an API point of view, the former is preferred because this is accessible across localised versions. Some built-in category and property names are defined by the API so you don’t need to remember them. Some of the categories/properties commonly found are exposed as more meaningful names in PropertyCategoryNames and DataPropertyNames respectively.
For example:

 

Meaningful string

Internal name

Displayname (English version)

PropertyCategoryNames.Item

LcOaNode

Item

PropertyCategoryNames.AutoCadEntityHandle

LcOpDwgEntityAttribs

Entity Handle

DataPropertyNames.Layer

LcOaNodeLayer

Layer

DataPropertyNames.AutoCadEntityHandleValue

LcOaNat64AttributeValue

Value

0 Likes