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: 

Automating Clash Detection using API

7 REPLIES 7
Reply
Message 1 of 8
JohnStory
5309 Views, 7 Replies

Automating Clash Detection using API

I want to try to script/automate Navisworks Manage in the Windows Task Scheduler to do the following:

  • Open a named NWF with a single predefined Clash Batch
  • Run the batch
  • Compact the Batch, don't really care about resolved items
  • Save the NWF
  • Run a Report to a specific format or take what was last defined manually in Manage
  • exit the session

 

What I was able to Google was a reference to "auto_04", and that it may give clues to this task. However, it is no longer in the examples.

 

The item under "api\COM\examples\Auto\AutoClashExample" looks like it may be the successor, but there are exactly "0" hits on Google to see if anyone has any insight into this routine, and there is no internal documentation as to how it goes about hte task.

 

Using Microsoft Visual Studio Express 2013, I can build it, but it does nothing when you run it except allow you to choose a NWD, then it crashes. I would have thought you would need to use a NWF.

 

Is this the correct tool for what I want to do? If so, is there any help you can provide to explain what this tool is trying to accomplish and how it goes about the task?

 

I will tell you now I am not familiar with Visual Studio, but I am trying to learn.

 

Should I be using a different version of Visual Studio? This is never clear and I cannot get a straight answer out of people at our company that do some Autodesk API programming, it seemd the answer is always "depends"...

 

Any help is always appreciated.

 

Thanks,

John

 

7 REPLIES 7
Message 2 of 8
JohnStory
in reply to: JohnStory

I was able to get some local instruction in Visual Studio and was able to make most of what I want to do work.

 

I can open the NWF, Run the Batch(s), remove Resolved, and save the NWF.

 

Still trying to understand how to invoke and control the Report functions.

 

Message 3 of 8
xiaodong_liang
in reply to: JohnStory

Hi John,

 

I am a little surprise google does not tell you our .NET API of Clash Detective. We have a couple of blog articles.

 

http://adndevblog.typepad.com/aec/2012/05/navisworks-net-api-2013-new-feature-clash-1.html

http://adndevblog.typepad.com/aec/2012/05/navisworks-net-api-2013-new-feature-clash-2.html

 

It is ok to use COM API, but as you may know, we do not add new abilities to COM API any longer. And I believe you have the experience on the advantages of .NET over COM. If you prefer to COM API,it is still qualified for your requirement in this post.

 

Yes, we migrated the VB6 samples to .NET. I have not VS2013 at this moment. But that sample AutoClashExample works well in VS2012. What kind of error you got? Or probably the blog below (using Clash of COM API in .NET) may give you some clues?

 

http://adndevblog.typepad.com/aec/2012/05/accessing-clash-report-information-using-net-api.html

 

 

 

 

Message 4 of 8
JohnStory
in reply to: xiaodong_liang

Xiaodong,

 

Thanks for the link suggestions. I had seen those articles before but will read through them again carefully to see if I can understand the flow and the reasoning.

 

I do try to research how others did similar things, to see if they have any interesting or relevent code fragments, so I started by searching "AutoClashExample" to see how people had described their use of that function. The Google of "AutoClashExample" now returns exactly two items, both are my original question on this forum, which indicates either people understand that example, or they have not used it at all.

 

I appreciate your confidence in my ability, but unfortunately it is not deserved. While I have done programming many years ago in C++, the .NET and other types from my current perspective are non-intuitive. It is difficult to understand why we need multiple programming interfaces (COM, .NET, etc...), they are not easily understood. For example, I had tried to collapse back the example code to a single program, removing the dialog, but the references to variables and other portions seem to be dependant on the dialog. At face value, this cannot be understood.

 

It is apparent I need training classes in this type of programming to understand how to do what is necessary for my task.

 

 

Based on what I think I understand, it appears that the "write report" actions are not explicitly functions like the "Update All" function and that you must take the returned clashes and loop/evaluate one by one to then report out through a user built function of your choice.

 

If this is the case, how do you address the return of "Quick Properties" information that is available when using the dialog based reporting? Properties returned would not be part of the Clash Definition Structure. Is it a single sub-structure that must then be recursed through?

 

 

 

Thanks,

John

 

Message 5 of 8
xiaodong_liang
in reply to: JohnStory

Hi John,

 

-      About AutoClashExample, it is a sample we just migrated from VB6. It is not strange to me there is not information on it in google. Even with VB6, there is not a help file to introduce the sample in detail. Since .NET API in 2011, we provided more and more materials, including the blogs. Because COM API is not our main focus anymore, we do not mention it much unless .NET API cannot achieve the abilities while COM can. I am sorry for the inconvenience because of the lack of the help reference. I believe it is not a big problem to you to understand the features in this sample. But if you hit any issues, please feel free to post them here. 

 

-      It looks you are migrating AutoClashExample to C++. The dialog of the sample is just for easy playing. you could pick up the core code only. 

 

-      Yes, API does not provide the direct method to write clash report. Since the report is just an XML or other text format, you could organize the report according to your requirement.  

 

-      "Quick Properties" is actually sub-set of object properties. We can set quick properties. See this blog:

http://adndevblog.typepad.com/aec/2013/02/create-quick-properties.html

 

I do not see a way to GET the quick properties, but you can get all properties by API. The SDK sample is a demo.

api\COM\examples\Auto\AutoUserPropsExample

 

Message 6 of 8

hi , can you share the project file ?

Message 7 of 8

Sorry, no... that attempted effort dropped shortly after the last post as "unworkable", both in practice and for my programming skill level.

 

We changed to use other methods a few years ago, unfortunately these are proprietary in the Company and cannot be shared.

Message 8 of 8
geethat
in reply to: xiaodong_liang

Hi @xiaodong_liang, The blog links are very useful. I have used moving clash tests to a group in my plugin. it is working great. But I have used that piece of code in a background worker for Progressbar in xaml to reflect the progress in UI and then the TestsInsertCopy() is throwing a stack overflow error even if the clash test has very few numbers of clashes. Could you help me rectify this error.

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report