import XML files of search set/saved viewpoints through API/command line

import XML files of search set/saved viewpoints through API/command line

Anonymous
Not applicable
2,985 Views
12 Replies
Message 1 of 13

import XML files of search set/saved viewpoints through API/command line

Anonymous
Not applicable
Hello, I already found some post not updated on that subject but the answer is until now not satisfying. I read that there is no API solution to use the standard import of XML files for search set neither for saved viewpoints available on NAVISWORKS by manual action. There is nothing neither usable with the command lines... The only solution I see is to build a plugin/programm that will read the XML files and create the correspondant search set and/or saved viewpoints. That already exists somewhere as it works well if the action is done manually when the XML is imported. Question 1 : Is ther now an API solution to import XML files to retrieve search set and/or saved viewpoints ? Question 2 : If (as I guess) the answer the question 1 is still "No" then When it will be available ? That will be very helpfull for a lot of users (especially for automation purpose) and it is very frustrating to now that something is already coded but not available... Thank you for your support. Regards,
2,986 Views
12 Replies
Replies (12)
Message 2 of 13

blindholm16
Contributor
Contributor

Any update on this ability with importing xml for Clash tests or Selection Sets? Agree with ychevalier that this function would be extremely helpful.


BL
0 Likes
Message 3 of 13

xiaodongliang
Contributor
Contributor
Hi,

Unfortunately, I do not see such API that is exposed. you have to create a plugin to parse the xml file and create the sets yourself, as what you have done.

I can log a wish to ask for this ability, but I cannot guarantee when it would be available. Sorry for any inconvenience
Message 4 of 13

xiaodongliang
Contributor
Contributor
the message above is posted through my personal account.
anyway, I can log a wish to ask for this ability
0 Likes
Message 5 of 13

xiaodong_liang
Autodesk Support
Autodesk Support
The message above are posted by my personal account.
0 Likes
Message 6 of 13

blindholm16
Contributor
Contributor

Please do log a wish for this ability to access the import functions already in place. Thanks.


BL
0 Likes
Message 7 of 13

Anonymous
Not applicable

Not sure if this will help you, but here is an (old) function I have used in VB6 to import a ViewPoints XML

 

Sub ImportViewPointsXML()

Dim oFso As New FileSystemObject
Dim Options As NavisworksIntegratedAPI11.InwOaPropertyVec

'Import ViewPoint XML File
If oFso.FileExists(strViewpoint_XML) Then
modLogFile.WriteEntry "Importing ViewPoint XML file"
Set Options = oState.GetIOPluginOptions("XmlViewpointsImportPlugin")
oState.DriveIOPlugin "XmlViewpointsImportPlugin", strViewpoint_XML, Options
Else
modLogFile.WriteEntry "ERROR - ViewPoint XML file not found - " & strViewpoint_XML & ". Skipping this Step !"
End If

Set oFso = Nothing

End Sub

0 Likes
Message 8 of 13

Anonymous
Not applicable

Hi !

 

First of all, thank you very much for your answers.

 

Particular thanks goes to darren.devenish for his proposal.

Unfortunatly, it doesn't work and I'll need your knowledge to explain me why it fails....

 

Please find here below the code I used based on the previous proposal :

 

Dim pathOf_XML_File As String = "C:\XML_File.xml"

 

If System.IO.File.Exists(pathOf_XML_File) Then

Dim state As Interop.ComApi.InwOpState11 = ComApiBridge.State

Dim Options As Autodesk.Navisworks.Api.Interop.ComApi.InwOaPropertyVec

 

Options = state.GetIOPluginOptions("XmlViewpointsImportPlug​in")

state.DriveIOPlugin("XmlViewpointsImportPlug​in", pathOf_XML_File, Options)

End If

 

There is no result with it (no error occurs but, there is no xml file loaded neither)

 

Xiadongliang, can you please also provide me the list of all internal plugins that exists (with the internal names) to allow me to use the both functions hereafter (from COM api documentation) :

HRESULT InwOpState4::GetIOPluginOptions([in] BSTR internal_name,
  [out, retval] InwOaPropertyVec ** opts 
 )   

Gets the default options for a named IO plugin,these can be modified and passed into DriveIOPlugin.

 

HRESULT InwOpState4::DriveIOPlugin([in] BSTR internal_name,
  [in] BSTR filename,
  [in] InwOaPropertyVecopts,
  [out, retval] nwEExportStatusres 
 )   

Makes a named IO Plugin execute on a filename.

 

Thank you all for your help 😉

 

Regards.

 

                           

0 Likes
Message 9 of 13

Anonymous
Not applicable

Yes, please log a wish for this ability.

0 Likes
Message 10 of 13

Anonymous
Not applicable

Hello again !

 

I'm still in the dark regarding the both following functions (from COM api documentation):

 

HRESULT InwOpState4:: GetIOPluginOptions([in] BSTR internal_name,
  [out, retval] InwOaPropertyVec ** opts 
 )   

Gets the default options for a named IO plugin,these can be modified and passed into DriveIOPlugin.

 

HRESULT InwOpState4:: DriveIOPlugin([in] BSTR internal_name,
  [in] BSTR filename,
  [in] InwOaPropertyVecopts,
  [out, retval] nwEExportStatusres 
 )   

Makes a named IO Plugin execute on a filename.

 

Where can I find the list of all internal plugins that exists (with the"internal_name") and their functionality ?

 

Thank you for your support.

 

Regards,

0 Likes
Message 11 of 13

ulski1
Collaborator
Collaborator

hi Xiaodong,

sorry that I post to a 2 year old post. I just wanted to hear if there is any news regarding support for import xml. Perhaps it is possible to start the xml import in the same way as the workaround you found for fbx export?

 

br

Ulrik

0 Likes
Message 12 of 13

kinjal
Enthusiast
Enthusiast

+1Ulrik

Its an old chain, i hope there is some news regarding this..! Looking forward..

Kinjal Desai
Fullstack developer @ Dwaravati
Delivering high quality programmatic boosts for your already beautiful Revit


0 Likes
Message 13 of 13

Anonymous
Not applicable

I am not sure how they did but certainly it's implemented in my plugin that got developed. So it's possible, there might be some apis.