Message 1 of 3
Not applicable
07-19-2019
10:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a Vb and Ilogic mash up that I need help make save the files into the right location.
The macro adds the assembly name to a custom Iproperty on all the Sheet metal parts and creates a folder called "Drawings, the assembly name" using:
Dim customPropSet As PropertySet
Dim invPartDoc As PartDocument
Set invPartDoc = ThisApplication.ActiveDocument
Set customPropSet = invPartDoc.PropertySets.Item("User Defined Properties")
Dim AssemblyName As Property
On Error Resume Next
Set AssemblyName = customPropSet.Add(oAsmName, "AssemblyName")and:
Dim oFolder As String
oFolder = oPath & "\" & "Drawings " & oAsmName
'Check for the DXF folder and create it if it does not exist
If Len(Dir(oFolder, vbDirectory)) = 0 Then
MkDir oFolderThe macro then runs the Ilogic rule on the parts which creates a drawing of the part and I need to save that drawing to the folder and I'm trying to use: which isn't working but it's not throwing error codes either it just saves the drawing next to the part like it did before I added this
oDrawDoc = ThisApplication.ActiveDocument
Dim oRef as Document
oRef = oDrawDoc.ReferencedDocuments.Item(1)
Dim New_Folder As String = ThisDoc.Path
Dim AsmName As String
AsmName = oRef.PropertySets.Item(4).Item("AssemblyName").Value
strNew = New_Folder & "\" & "Drawings " & AsmName
ThisDoc.Document.SaveAs(strNew & filename, True)
Solved! Go to Solution.