Document manager don't allow because it don't open document graphically.
Check that link for (limited) possibilities : 2015 SOLIDWORKS API Help - SOLIDWORKS Document Manager API Help
Reading Cetin's question I think this is exactly what SOLIDWORKS Document Manager is designed to do - retrieve external files references without opening the file in SOLIDWORKS.
Perhaps I've misunderstood.
Yes.... I can open solidworks and use its api. however it takes lots of time... If it is possible I want to use document manager api to reach same aim. I did not find anything in the document manager therefore I asked it to forum. May be some one knows?
Document Manager API allows to do following tasks:
Allows you to write applications that emulate file management tools to perform such tasks as renaming, replacing, and copying SOLIDWORKS documents.
It is an independent software component that provides read-write functionality for SOLIDWORKS documents. It includes interfaces for the document and configurations. These interfaces have read-only and read-write properties and methods.
Here are some lines from example in API help file, you can see the Daniel's link for complete example:
Dim dmClassFact As SwDMClassFactory
Dim dmDocMgr As SwDMApplication4
Dim dmDoc As SwDMDocument18
dmClassFact = CreateObject("SwDocumentMgr.SwDMClassFactory.1")
dmDocMgr = dmClassFact.GetApplication(sLicenseKey)
dmDoc = dmDocMgr.GetDocument(sDocFileName, GetDocType(sDocFileName), True, nRetVal)
"getting bounding box information from document manager" - You're out of luck there I'm afraid.
SOLIDWORKS Document Manager is designed to provide lightweight access to SOLIDWORKS data. To keep it lightweight, SWDM does not have access to all of the data contained in the file, only a small subset. Modifying SWDM to allow access to bounding box data would result in a significant performance regression for most existing client applications.
can you share the code? I'm working on vb.net to get the assembly component list (a simple path list of the components....same as PackAndGo but without opening SW)but without success. My starting point is this 2015 SOLIDWORKS API Help - Replace Component (VB.NET) , I have the license string and I only change this part
Dim bResult As Boolean = swDmComponent.Replace("C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\samples\tutorial\smartcomponents\lockwasher.sldprt", "Default", False)
to avoid any replace....I need to fill only an array!
The error comes from here
vComponents = DirectCast(activeConfig.GetComponents(), Object())
when the code call lenght
For i = 0 To vComponents.Length - 1
the object is always NULL.
Visual studio express 2015
I found the problem: using windows7 and vs 2013 it works.
Now next question: how getting components list included nested assembly?