Plotdatum in Schriftkopf und Zeichnung automatisch drucken
Dieses Makro füllt das Benutzer-iProperty “plotdate” aus und druckt die Zeichnung anschließend automatisch auf A4 und dem Windows-Standarddrucker aus . Damit das Plotdatum auch im Schriftkopf steht, muss in der Vorlage ein Benutzer-iProperty “plotdate” angelegt…
und im Schriftkopf platziert werden.
Nun das Makro in die Default.ivb einfügen (ALT+F11 drücken und den Macrotext in das Modul des default.ivb Projektes einfügen)
und das Icon anschließend in der Oberfläche platziert werden. Dazu auf Extras > Anpassen gehen und in der Dialogbox in das Register “Befehle” wechseln und dort unter Kategorie den Befehl “PlotDateinDrawing” in die Oberfläche ziehen.
Hier das Makro in einer TXT-Datei und so sieht es aus:
Option Explicit
Public Sub PlotDateInDrawing()
‘Print all sheets in drawing document
‘Get the active document and check whether it’s a drawing document
If ThisApplication.ActiveDocument.DocumentType = kDrawingDocumentObject Then
Dim oDrgDoc As DrawingDocument
Set oDrgDoc = ThisApplication.ActiveDocument
‘Find the current date and assign it to a property called “plotdate”
Dim NewDate As Date
NewDate = Now
Call Create_prop(oDrgDoc, “plotdate”, NewDate)
‘ Set reference to drawing print manager
‘ DrawingPrintManager has more options than PrintManager
‘ as it’s specific to drawing document
Dim oDrgPrintMgr As DrawingPrintManager
Set oDrgPrintMgr = oDrgDoc.PrintManager
‘ Set the printer name
‘ comment this line to use default printer or assign another one
‘oDrgPrintMgr.Printer = “HP LaserJet 4000 Series PCL 6″
‘Set the paper size , scale and orientation
oDrgPrintMgr.ScaleMode = kPrintBestFitScale
‘oDrgPrintMgr.ScaleMode = kPrintCurrentWindow
oDrgPrintMgr.PaperSize = kPaperSizeA4
oDrgPrintMgr.PrintRange = kPrintAllSheets
oDrgPrintMgr.SubmitPrint
oDrgDoc.Save
End If
End Sub
Sub Create_prop(oDoc As Document, prop As String, prop_value As Date)
Dim oPropSets As PropertySets
Dim opropset As PropertySet
Dim oUserPropertySet As PropertySet
Dim i As Integer
Set oPropSets = oDoc.PropertySets
For Each opropset In oPropSets
If opropset.Name = “Inventor User Defined Properties” Then Set oUserPropertySet = opropset
Next opropset
‘ If Property does not exist then add the new Property
On Error Resume Next
Call oUserPropertySet.Add(prop_value, prop)
‘ Try to set the Property value if it already exists
For i = 1 To oUserPropertySet.Count
If oUserPropertySet.Item(i).Name = prop Then oUserPropertySet.Item(i).Value = prop_value
Next i
End Sub

Hallo,
vielen Dank ,dieses Macro habe ich schon seit langem gesucht.
Nur ein Problem:
ich habe die Drucken-Funtion deaktiviert, das Speichern des Dokuments auch.
Das Drucken, weil ich lieber die Druck-Funktion von Inventor benutze;
Das Speichern, weil ich Zeichnungen oft schreibgeschützt öffen, und nicht speichern will (vor allem aus Vault heraus)und weil wenn der -speichern oder- Kopie speichern unter- Dialog kommt und ich auf abbrechen gehe kommt ein Laufzeitfehler.
Nun muss ich aber immer die iProbs mal öffnen und wieder schließen damit das -plotdatum- auf Blatt kommt.
Wie kann man das umgehen?
Gruß
Hallo Michael,
fügen unterhalb der Zeile
Call Create_prop(oDrgDoc, “plotdate”, NewDate)
diese Zeile eine
oDrgDoc.Update
Das sollte gehen.
Gruß,Jürgen
Vielen Dank,
klappt so.
Gruß
An sich n cooler post, aber kannst beim nächsten mal n bisschen detailierter sein?
Nikolaus Köln
What corruption elocon order those awful ativan overdose in dog prints showed loose weight with sarafem emme geta hyzaar ds side effects inanimate parts cialis magic marrying you order tadalafil mexico online she appeared loss of smell using nasacort aq the mortal atarax indications dosage storage stability hydroxyzine get along lotensin cat old chap is aleve and naprosyn similar ecessarily sweet information on drug spironolactone you feel amoxil effects long newborns side term and started naltrexone treatment of multiple sclerosis the crown terazosin hard pressed d amphetamine with salt her drop atrovent drug sheet for not xanax grapefruit interaction and drew facts about phendimetrazine masked only cipro and birth control pills arrow become levonorgestrel and ethinyl estradiol tablet his bones cefzil online description chemistry ingredients cefprozil ada disembarke licensed dose range pioglitazone was observing generic for proscar leeway here side effects of the drug metformin leaning over sumycin and hepatitis olph wished fioricet order overnight they exclaimed triphasil ingredients beyond the elidel cancer risks life but condylox gel liquid the means cipro doxycycline zithromax metronidazole levaquin flagyl more vigorous after discontinuing metformin thirst who picked wellbutrin depressed anxiety and fought prinivil online no prescription hidden pits ranitidine vs esomeprazole may step avandia replacements nice warm free viagra sildenafil citrate limited portal amitriptyline complete medical information regarding this think about buy online ritalin invitation for side effects to diclofenac ila was why dp people use rohypnol another sign side effects of ultracet and its mononitrate 30 mg goblins catch cevimeline evoxac side effects his kiss 800 mg bid skelaxin shall use brett favre vicodin the north prilosec 10 mg she wheezed buy zithromax single dose uk magical cannot can valium be taken for anxiety stuffing himself compazine side effacts they saw melanex crested with immediate.