Znaleziono 2 wyniki

autor: PIBAL
19 maja 2014, 08:10
Forum: Autodesk Software (Autocad, Inventor etc)
Temat: "Save Copy As" W moim przypadku - PDF (iLogic) + K
Odpowiedzi: 3
Odsłony: 1531

Wysyłając kod liczyłem na szczątkową znajomość VBA ;) dlatego nie tłumaczyłem.
autor: PIBAL
16 maja 2014, 09:23
Forum: Autodesk Software (Autocad, Inventor etc)
Temat: "Save Copy As" W moim przypadku - PDF (iLogic) + K
Odpowiedzi: 3
Odsłony: 1531

1. Odpuść sobie pisanie kodu do generowania plików exportowanych w sklepie http://apps.exchange.autodesk.com/pl znajdziesz masę rewelacyjnych, dopracowanych wtyczek.
2. Jeśli już musisz tu masz kod:

AD1 - nie ma globalnej zmiany grubvosci lini - musisz zmieniac w edytorze stylow kazda kolejno grubosc linii modelu to (visible, albo "widoczne" z tego co pamietam)
AD2 tak - również edytor styli - warstwy
AD3 Oczywiście, ale z poziomu głównego projektu VBA






'------start of iLogic-------
oPath = ThisDoc.Path
oFileName = ThisDoc.FileName(False) 'without extension
oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium

'Define the drawing
Dim oDrawing As DrawingDocument
oDrawing = ThisDoc.Document

Dim oSheet As Sheet
Dim lPos As Long
Dim rPos As Long
Dim sLen As Long
Dim sSheetName As String
Dim iSheetNumber As Integer

'step through each drawing sheet
For Each oSheet In oDrawing.Sheets

'find the seperator in the sheet name:number
lPos = InStr(oSheet.Name, ":")
'find the number of characters in the sheet name
sLen = Len(oSheet.Name)
'find the sheet name
sSheetName = Left(oSheet.Name, lPos -1)
'find the sheet number
iSheetNumber = Right(oSheet.Name, sLen -lPos)

'set PDF Options
If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
oOptions.Value("All_Color_AS_Black") = 1
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintSheetRange
oOptions.Value("Custom_Begin_Sheet") = iSheetNumber
oOptions.Value("Custom_End_Sheet") = iSheetNumber
End If

'get PDF target folder path
oFolder = "O:\"
'MsgBox(oFolder)

'Check for the PDF folder and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder) Then
System.IO.Directory.CreateDirectory(oFolder)
End If


'Set the PDF target file name
oDataMedium.FileName = oFolder & "\" & oFileName & ".pdf"

' oDataMedium.FileName = oFolder & "\" & oFileName & " " & sSheetName & " " & iSheetNumber & ".pdf"

'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)

Next
'------end of iLogic-------

Wróć do „"Save Copy As" W moim przypadku - PDF (iLogic) + K”