DocumentManager(API) in Windev /Replaces DSOFiles Custom Properties

Hello

I'm looking for an example of how to use SolidWorks.Interop.swdocumentmgr.dll in Windev, without opening Solidworks. 

In Solidworks V2011, I used the custom settings of the Solidworks documents as interfaces with my specific ERP in Windev. I was using DsoFiles, which had access to these settings. This allowed me to update these settings without opening Solidworks; An example:

Make a copy of a +parts +drw assembly from one customer to another customer by changing all custom properties to those of the new customer. BOM lines are created dynamically (Windev) and the information passed by DSOFiles to the Solidworks docs. (The copy continues by a change of name of the parts and the recopy of the dependencies but it's a part that still works in 2015 because the compatibility has been kept, at least I hope :) ).

Custom settings for Solidworks V2015 documents are no longer available with DSoFiles -> this is a Microsoft (Office) decision, followed by Solidworks.

Now you have to use the APIs of the SolidWorks.Interop.swdocumentmgr.dll DLL, to manage these parameters. It's well documented in VB but I couldn't call this DLL in Windev (V20). 

I can use the Solidworks  kernel APIs  very well:

SwAppDocDepencies is a Dynamic Automation object
SwAppDocDepencies = allocate Automation object "sldworks. Application"

On the other hand, impossible with SolidWorks.Interop.swdocumentmgr.dll. In 2 weeks, I tried everything that the Hot Line gave me as information (but in VB.NET), everything I found on the NET... But there is nothing on the subject in Windev!

So I can't switch to V2015 until I find the solution!

So if you've already done that, please send me a piece of code, I promise you 1st praise :)

Sincere greetings.

PS: I haven't found an ERP interface or API domain to determine the domain of the qustion

 

 

1 Like

Hello

I don't think WinDev is compatible with SW's Document Manager.

Windev is a software that is not very widespread.

I made the relationship with our ERP in Vb.net. I imagine you want to keep part of your project on windev. It is then possible for you to develop an application in Vb.net that will be related to your Windev app.

[Edit: ] What are the answers of the Hotline? Have you applied for the license to be able to use the Document Manger API?

 

Hello

Thank you for the answer.

I don't see why Document Manager wouldn't be compatible with Windev. The Solidworks application is easy to handle in Windev, I managed to translate everything I had done in Visual into windev, the advantage is not to have a Visual interface.

The Hot Line tells me that it is feasible but all the indications are in VB.net.

Yes, I have the key to use.

The following commands must be 'translated' into windev:

Imports SolidWorks.Interop.swdocumentmgr

swClassFact = CreateObject("SwDocumentMgr.SwDMClassFactory")
swDocMgr = swClassFact. GetApplication(sLicenseKey)

I did indicate that I used the DLL in Windev, the one corresponding to Frameworks 4 (4.5 on my PC)

C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\api\redist\SolidWorks.Interop.swdocumentmgr.dll

I have registered the DLL as indicated in the doc. :regsvr32  "<disk>:\Program Files\Common Files\SOLIDWORKS Shared\SwDocumentMgr.dll"

I still get the error "SwDocumentMgr.SwDMClassFactory" is not installed on your system!

 

It is also necessary to translate the declarations:

Imports SolidWorks.Interop.swdocumentmgr

-----------------------------------------------------------------------------------------------------------------------------------

Dim swClassFact As SwDMClassFactory
Sun swDocMgr As SwDMApplication4

-----------------------------------------------------------------------------------------------------------------------------------

swClassFact = CreateObject("SwDocumentMgr.SwDMClassFactory")
swDocMgr = swClassFact.GetApplication(sLicenseKey)

 

 

How do you go about windev?

Can you post an image of your windev interface?

Hello

Which I think is correct but it doesn't work.

swClassFact = CreateObject("SwDocumentMgr.SwDMClassFactory")

swClassFact is a Dynamic Automation object

swClassFac = allocate Automation object "wDocumentMgr.SwDMClassFactory"

-> but answers "wDocumentMgr.SwDMClassFactory" is not installed on your system


swDocMgr = swClassFact.GetApplication(sLicenseKey)

swDocMgr is a Dynamic Automation object

swDocMgr = swClassFact>>GetApplication(sLicenseKey)

>> allows you to call a function, but when I get there I'll be happy!

So no one has used wDocumentMgr with Windev?

Kind regards

 

 

 

In Windev, after adding the dll as a reference you can't get the types SwDMClassFactory and SwDMApplication4 ?

Because what I understand is that you don't use them.

Hello

I see that you are moving forward: http://forum.pcsoft.fr/fr-FR/pcsoft.fr.windev/73037-traduction-code-windev/read.awp

Why are you not sure about your key?

Why isn't it just a channel?

For lack of anything better, I used Solidworks and automation.

In fact it works well, with large PCs, it's a little longer, since Solidworks has to open the room. But it allows you to see the macro doing its job or not.