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: 

CLASH DETECTION (SELECTION A & B) APPLY SELECTION SET

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
1176 Views, 5 Replies

CLASH DETECTION (SELECTION A & B) APPLY SELECTION SET

Hi there,

 

I hope you are well.

 

I am wondering if there is a way via API to select selection/search set when applying Selection A and Selection B on ClashTest?

 

At the minute what I do is the following (python).

# allsetinfolder are all the set I have in the nwf, below I am getting the first and the second as an example #
f = allsetinfolder[0].GetSelectedItems() s = allsetinfolder[1].GetSelectedItems() ######################### clash ######################## doclash = doc.Clash alltd = doclash.TestsData ftest = alltd.Tests[0] copy = ftest.CreateCopy() copy.SelectionA.Selection.CopyFrom(f) copy.SelectionB.Selection.CopyFrom(s)

# When I do the above as I am using GetSelectedItem, I am doing an ModelItem Collection #

So it is display like:

clashdetection.PNG

 

Which is correct, it is taking all the walls and Doors.

 

However what I am after is to be displayed by Selection Set as:

setclashes.PNG

Thank you very much in advance

5 REPLIES 5
Message 2 of 6
Allard_DStudio
in reply to: Anonymous

I am trying to figure out the same... Also no luck for the moment. A little bit sad, but i am considering to first make an xml for the clashtests and import that. Like that it is possible.

Message 3 of 6
CJModis
in reply to: Anonymous

var sourceCollectionA = new SelectionSourceCollection();
var sourceCollectionB = new SelectionSourceCollection();

foreach (var savedItem in doc.SelectionSets.Value)
{
    foreach (var selectionSet in GetSelectionSets(savedItem, group1.SearchSets.ToList()))
    {
        sourceCollectionA.Add(doc.SelectionSets.CreateSelectionSource(selectionSet));
    }

    foreach (var selectionSet in GetSelectionSets(savedItem, group2.SearchSets.ToList()))
    {
        sourceCollectionB.Add(doc.SelectionSets.CreateSelectionSource(selectionSet));
    }
}

clashTest.SelectionA.Selection.CopyFrom(sourceCollectionA);
clashTest.SelectionB.Selection.CopyFrom(sourceCollectionB);
Message 4 of 6
jlpLATQ9
in reply to: Anonymous

Is it possible to see the entire code CJModis as I cant find a reference for GetSelectionSets

Message 5 of 6
jlpLATQ9
in reply to: CJModis

Is it possible to see the entire code CJModis as I cant find a reference for GetSelectionSets

Message 6 of 6
CJModis
in reply to: jlpLATQ9

This method is not from the API and is not important for the question. The method returns sets of search queries

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report