Hi!
In the Select and Search panel, you have the option to select the object with the same <property>. Inside my model, there is like 20 properties for example: equip #, iso #, line # etc.
Can I select which property I want the model to look at when I click on Select same -> properties
When I select a pipe for example, I would like to select all the pipe that as the same line #. When I click on select same - properties, nothing happend. Why? Is it because all the properties need to be the same to be selected?
I know I can get all pipes with same line # if I select that line # inside the selection tree-->properties tab--> line # but I need something quicker than that.
I tried to changed the selection resolution but no one is made for my need. In a perfect world, I would like to add another tab to the selection resolution for line #!
Does anyone have a solution to do it through the API?
Thanks
I see this is an older thread but was wondering the exact same thing, does anybody have an answer for this?
Thanks
Doug
Hi,
I do not fully understand what the question is, but I'd recommend with the two blogs
http://adndevblog.typepad.com/aec/2012/05/navisworks-net-api-find-item.html
http://adndevblog.typepad.com/aec/2012/07/use-search-api.html
API has much flexible methods to do search. Hope you could find some clues. If you still need help, please elaborate the question and share some neccessary samples.
Hi Doug,
I wrote a plugin to do something very similar to what you are looking for, the core code is dead simple:
Private Sub SelectAllWithPropertyValue(ByVal CategoryName As String, ByVal PropertyName As String, ByVal Value As VariantData) Try Dim S As Search = New Search With {.PruneBelowMatch = False, .Locations = SearchLocations.DescendantsAndSelf} S.Selection.SelectAll() Dim ADoc As Document = Autodesk.Navisworks.Api.Application.ActiveDocument S.SearchConditions.Add(SearchCondition.HasPropertyByDisplayName(CategoryName, PropertyName).CompareWith(SearchConditionComparison.Equal, Value)) ADoc.CurrentSelection.CopyFrom(S.FindAll(ADoc, False)) Catch ex As Exception MessageBox.Show(Autodesk.Navisworks.Api.Application.Gui.MainWindow, ex.Message) End Try End Sub
where categoryname, propertyname and value help you find all the objects you want.
I spent a lot of time trying to get this automatically triggered on user selection of either the tree or the 3D, so that it looks exactly like a selection resolution, unfortunately I ran into some limitation of the API where an event handler of the "selection change" event is not allowed to modify the selection itself (even if remove the handler, modify the selection, add the handler back)
-Nic
Thanks for the respones, I may have posted in the wrong section I guess as I only have the Navis Viewer. As per your responses it appears that there is no way to accomplish this in the viewer at this time, and I dont have access to insert API code...
Thanks
Doug