Hello
Is there a way to extract the references from a file from vb.net?
I looked in the Solidworks visual basic API but found nothing concrete :/
Kind regards
Hello
Is there a way to extract the references from a file from vb.net?
I looked in the Solidworks visual basic API but found nothing concrete :/
Kind regards
http://help.solidworks.com/2014/english/api/sldworksapiprogguide%5Cgettingstarted%5Cvisual_basic_.net_standalone_and_add-in_applications.htm
See this comm thread
http://www.lynkoa.com/forum/autres/vba-excel-pour-solidworks
@+ ;-)
Hello .PL & gt22
Indeed the declaration is mandatory which I have already done because currently I already change references with my software the problem is that I have to fill them in one by one in a table that's why I try to extract the references directly :)
I would like to be able to retrieve from an ASM or DRW type file the references they have
Example:
The "drawing 1.SLDDRW" file refers to the assembly "assembly1. SLDASM"
The "assembly1. SLDASM" Refers to the part "Piece1.SLDPRT"
I would like to retrieve the values "assembly1. SLDASM" and "Piece1.SLDPRT" in automatic
I don't know if I'm understandable :/
You have to use getfirstview to retrieve the basemap, then getnextview to retrieve the first view, and finally referenceddocument to have access to the corresponding 3D file.
I think there's an example in this macro I posted on Lynkoa:
http://www.lynkoa.com/tutos/3d/macro-enregistrer-sous-avec-solidworks
Thank you for your answer.PL
I just looked at your code and it seems to me Complex for what I want to do, by that I mean that from solidworks by clicking on a drawing more on reference you get the window as an attachment and it would suit me greatly because it contains the folder and the name of the part
Hello
You are actually looking to get the same results as by doing File/Search for references and then the "Copy list" button. That's right?
Then all you have to do is paste it into an Excel file.
Hello Benoit.LF,
Indeed this is what I want to get the info directly after I would not go through excel but directly stored in vb.net but that's it! :)
The macro I posted does something else of course, but it's the beginning of the code that's interesting for this application.
See this link which gives the same solution:
http://help.solidworks.com/2012/English/api/sldworksapi/Get_Document_Referenced_by_Drawing_View_Example_VB.htm
http://help.solidworks.com/2012/English/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IAssemblyDoc~GetComponents.html
http://help.solidworks.com/2013/English/api/swdocmgrapi/Get_All_External_References_for_Drawing_Example_VBNET.htm
I found a Provisional solution that may take a long time, I change ALL the references, even the one that doesn't exist, SOlidWorks doesn't flinch.
Hello
The API to use is : GetDocumentDependencies2
http://help.solidworks.com/2013/english/api/sldworksapi/solidworks.interop.sldworks~solidworks.interop.sldworks.isldworks~getdocumentdependencies2.html
it returns all external references of the file
Philippe