I would like to know if there is command which can only read a file, but not literally open it in SolidWorks? I know the OpenDoc6 can open a file, but I only need to read some of the files configuration.
Thanks for your help!
You can use Document Manager to get those details without opening the files GetConfigurationNames Method (ISwDMConfigurationMgr)
Thank you Deepak! It was my fault not write specifically. I know GetConfigurationNames, but I dont know how to read a file. Please see the codes below.
Dim swModel As IModelDoc2
Dim configNames() As String
Dim errors As Integer
Dim warnings As Integer
Dim fileName As String
fileName = "C:\Users\Public\Documents\SOLIDWORKS\SOLIDWORKS 2017\tutorial\smartcomponents\pillow_block.sldasm"
swModel = SwApp.OpenDoc6(fileName, swDocumentTypes_e.swDocPART, swOpenDocOptions_e.swOpenDocOptions_Silent, "", errors, warnings)
'Here is my question. The line above can open a file, then the further codes may work with the opened file.
'But I dont want this file in SolidWorks opened. I just want to 'load' it into working memory. The further codes could still work with this file.
'Get names of all configurations
configNames = swModel.GetConfigurationNames 'If a file is 'loaded' but not opened, I can use GetConfigurationNames.
How can I do this?
Thank you again.
have you read Deepak's link?
Yes of course I have read. I actually want to read a file, not only want to GetConfigurationNames.
DocumentManager has some limited functionality. Depend on what you want to see. Otherwise you can open the file invisible in SolidWorks.
I want to read the file into memory, then work invisible with this file.
In my codes above, I have the swOpenDocOptions_Silent, but the file is opened anyway.
Any suggestions? Thanks.
2012 SOLIDWORKS API Help - DocumentVisible Method (ISldWorks)
Retrieving data ...