Hello
Let me explain my problem, I currently have an excel file from which I want to open my 3D (which I manage to do)
then.... save them in . DXf in a specific folder with the path "G:\DAO\Iges-fao" and renaming them with the ERP code that appears in the data map as well as the index (Revision)
I started to write the beginning of the macro but I get stuck at the level of recording the 3D in DXF :-(
I attach the code as well as the printout of the data card
Can you help me
Dim choix_liste As String 'type de pi?ce choisi dans la liste d?roulante pour l'ouverture des pi?ces
Dim nb_de_piece As Integer 'nombre de lignes de la colonne F correspondant aux nombres de pi?ces
Dim increment As Integer 'incr?ment de 1 pour effectuer la boucle de recherche ligne par ligne sur la colonne F
Dim myCell As String 'variable pour fusionner l'incr?ment et la colonne F pour la plage de recherche
Dim path As String 'chemin du dossier d'enregistrement de la pi?ce
Dim nom As String 'nom de la pi?ce
Dim path_complete As String 'chemin complet de la pi?ce
Dim myBool As Boolean
Dim myError As Long, myWarning As Long
Dim swApp As Object
Dim Part As Object
Dim longstatus As Long
'ouverture de SolidWorks :
myBool = Shell("C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\SLDWORKS.exe", vbNormalFocus)
Application.Wait Now + TimeValue("0:00:10")
Set swApp = CreateObject("SldWorks.Application")
'Set swApp = Application.SldWorks
Set swApp = CreateObject("SldWorks.Application")
Set swModel = swApp.OpenDoc6("C:\_FICHETBAUCHE\03 projets\01 safes\pbz00371\technical file\02 cad\millium-newton feu, cadre modifi? caisse ext pop?e\SW00239874.sldprt", 1, 1, "", myError, myWarning)
Set Part = swApp.ActiveDoc
' Named View
Part.ShowNamedView2 "*Dessus", 5
Part.ViewZoomtofit2
Set Part = swApp.ActiveDoc
' Save As
Set swModel = Part.SaveAs3("G:\DAO\Iges-fao\SW00246182.DXF", 0, 0)
' Save As
'swModel.SaveAs2 Left(path, (Len(path) - 6)) & "dxf", 0, True, False
' boucle a creer
'definition de la plage sur lequel va s'appliquer la macro :
'Initialisation de certaines variables:
' valeur de la conne x = "Nouveau" et Valeur de la colonne Y = " Fabriquée" et "Pièces/Opé panoplies"
nb_de_piece = Application.WorksheetFunction.CountA(Feuil1.Range("$H:$H")) 'nombre de cellules non vide dans la colonne F, soit le nombre de pi?ces
increment = 1
'For increment = 1 To der lign
' End If
'Next increment 'on passe ? la ligne suivante
End Sub
thank you in advance
image.docx