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: 

The question about InwExportPlugin_iExport in COM API function...

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
bnn987654321
1396 Views, 6 Replies

The question about InwExportPlugin_iExport in COM API function...

Is there any way to automate InwExportPlugin_iExport?

I mean, I don't need to click the export button on the menu,and directly through the program can do this automatically.

Because the method described in the document is that 'It is also possible to have no added menu items. Instead you may just be using nwOpState’s Events to look for things happening.'

Does anyone know how to do this?

Please tell me,thank you.

6 REPLIES 6
Message 2 of 7

Hi bnn987654321,

 

Frankly, I am not quite clear on your requirement. In what stage you need to run custom work (such as run clashtest and write a report):

1)      Do you want to run the work when the document is opened, with a timer, e.g. run/5 minutes?

2)      or you just want to batch generating the clash report for many files?

 

If 1), I think you could create a menu to start a timer, which runs the custom work. I have not tried it, though. As to the state events, I do not think they are appropriate for you because most of them are fired when something updated/changed. But if your workflow is , e.g. when current selection is changed, run custom work, it is fine to use the relevant events.

If 2), you could use Windows Task Scheduler to run the automation code.

 

Best regards,

 
autodesk_logo_signature.png

Xiaodong Liang

Developer Consultant

Autodesk Developer Technical Services

Message 3 of 7

Thank for your reply.

My requirement is 2)

But I don't know how to make InwExportPlugin_iExport happen automatically.

I use the COM API sample code AUTO_04 as a basis for my program,

and join a part of the COM API sample code PLUGIN_03.

But I can't get the picture in the results.

It return ps is nothing when Set pd = state.CreatePicture(anon, , 320, 200)

 

Dim testresult As InwOclTestResult
For Each testresult In clashTest.results()
    Dim av As InwOpAnonView
            
    Set av = m_state.ObjectFactory(eObjectType_nwOpAnonView)
    av.ViewPoint = testresult.GetSuitableViewPoint
            
    Dim pd As IPictureDisp
        

    Set pd = m_state.CreatePicture(av, , 320, 200)
    SavePicture pd, "C:\\clash1.bmp"
Next

Message 4 of 7

In the .NET API.chm, says that identify the interfaces available in the COM API and the equivalent class in the .NET API.

So, I can use the AddInPlugin to replace the InwExportPlugin???

But I can't find the way to export the clash results in the .NET API!

Any suggestion?

Message 5 of 7

Hi bnn987654321,

 

The Variant returned by CreatePicture is an IPictureDisp. And the method can only be used by in-process application. While AUTO_04 is out of process. Hope this explains.


Clashtest in .NET API:  please refer to the attached sample code. It shows how to access clash test in .NET API, by COM interop. Please note: clash test API does not provide a way to export the result to xml, text etc like product. you need to write out the file with the properties of the objects InwOclTestResult, InwOclClashTest

 

 

Best regards,

 
autodesk_logo_signature.png

Xiaodong Liang

Developer Consultant

Autodesk Developer Technical Services

Message 6 of 7

Thank you.

I can get most of the necessary information now.

But I still have a problem.

I want to access the Item1's name and Item2's name in the clash test.

I try to get data from clashResult.Path1.Nodes(),but failed.

My Navisworks Ver is 2012, and the attached file is my sample model.

Please tell me how to solve this.

 

Message 7 of 7

I have solved the problem, thank you for your reply.

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

Post to forums  

Rail Community


Autodesk Design & Make Report