06-06-2021
01:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-06-2021
01:06 PM
I've been tweaking a .dxf export rule, and I've ran into a problem.
I can't create the folder on our server drive. Its a seperate server, and I'm pretty sure,
I have admin access.
The thing is that I can manually create a folder, with the right name, and then the files,
will be able to save to that folder.
The variale aOrdreNr is a userparameter, I have in my assembly. Its put as unitless.
Is there a way to get around this problem?
Mind you, this works if I use the C: drive, as path.
Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument
If oDoc.DocumentType <> kAssemblyDocumentObject Then
MessageBox.Show("Denne funktion SKAL køres i Assembly fil", "DABO")
Exit Sub
End If
RUsure = MessageBox.Show ( _
"Denne funktion vil lave DXF Filer af alle dele i samlingen." _
& vbLf & " " _
& vbLf & "Sørg for at funktionen GEM ALLE SOM KOPI har kørt inden denne funktion." _
& vbLf & "Denne funktion kan tage tid. Din mappe bliver vist tilsidst.", "DABO Export DXF ",MessageBoxButtons.YesNo)
If RUsure = vbNo Then
Return
Else
End If
oPath = ("C:\Gulvsug\" & aOrdreNr & "\")
Dim oRefDocs As DocumentsEnumerator
Dim oRefDoc As Document
oRefDocs = oDoc.AllReferencedDocuments
For Each oRefDoc In oRefDocs
Dim oCurFile As Document 'current file
Try
oCurFile = ThisApplication.Documents.Open(oRefDoc.FullFileName, False)
Catch
GoTo NextIteration
End Try
If oCurFile.DocumentSubType.DocumentSubTypeID <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
oCurFile.Close(True)
Else
oCurFileName = oCurFile.FullFileName
FNamePos = InStrRev(oCurFileName, "\", -1)
FName = Right(oCurFileName, Len(oCurFileName) - FNamePos)
FName = Left(FName, Len(FName) - 4)
DxfName = oPath & aOrdreNr & "-" & aOrdrePre & " " & FName & ".dxf"
Dim oSMCD As SheetMetalComponentDefinition = oCurFile.ComponentDefinition
If Not oSMCD.HasFlatPattern Then
oSMCD.Unfold()
oSMCD.FlatPattern.ExitEdit()
End If
Dim sOut As String = "FLAT PATTERN DXF?AcadVersion=2004" _
+ "&OuterProfileLayer=IV_INTERIOR_PROFILES" _
+ "&InvisibleLayers=IV_TANGENT;IV_FEATURE_PROFILES_DOWN;IV_BEND;IV_BEND_DOWN;IV_TOOL_CENTER;IV_TOOL_CENTER_DOWN;IV_ARC_CENTERS;IV_FEATURE_PROFILES;IV_FEATURE_PROFILES_DOWN;IV_ALTREP_FRONT;IV_ALTREP_BACK;IV_ROLL_TANGENT;IV_ROLL" _
+ "&SimplifySplines=True" _
+ "&BendLayerColor=255;255;0"
Try
oSMCD.DataIO.WriteDataToFile(sOut, DxfName)
Catch
End Try
oCurFile.Close(True)
End If
NextIteration:
Next
MessageBox.Show("Alle DXF Filer exporteret til: " & vbLf & oPath & vbLf & vbLf & "Tjek venligst filerne, inden brug.", "DABO")
Shell("explorer.exe " & oPath,vbNormalFocus)
Solved! Go to Solution.