Rule with plot stamp adds wrong format

Rule with plot stamp adds wrong format

autodeskplusplanung
Enthusiast Enthusiast
1,046 Views
18 Replies
Message 1 of 19

Rule with plot stamp adds wrong format

autodeskplusplanung
Enthusiast
Enthusiast

With the great help of this forum I created the following rule. It creates a border with a Plotstamp.

So fare it works great. But now I have a drawing with several sheets, some of them in different formats.

If I now run the rule and save all sheets, it places a border with the same format as the active sheet on all sheets. That is not always correct, as you may suspect 🙂 .

Any ideas how to change the rule to get it working correct?

'This sets the Custom iProperties to the appropriate values
Name= ThisApplication.GeneralOptions.UserName
PSDate = Now.ToShortDateString
PSTime = Now.ToShortTimeString
Pfad = ThisDoc.WorkspacePath
Datei = ThisDoc.FileName(True) 'with extension

'Exteranal Rule to Run on Legacy Border
ActiveBorder = ActiveSheet.Border
If ActiveBorder <> "Normrahmen PP mit Plotstamp" Then
	iLogicVb.RunExternalRule("Rahmen_mit_Druckdatum")
End If

iProperties.Value("Custom", "PlotStamp") = "|" & Name & ", " & PSDate & ", " & PSTime
iProperties.Value("Custom", "Projektpfad") = Pfad & "\" & Datei

InventorVb.DocumentUpdate()

'Printing Commands
Dim oCtrlDef As ControlDefinition
oCtrlDef = ThisApplication.CommandManager.ControlDefinitions.Item("AppFileExportPDFCmd")'AppGetStartCmd
oCtrlDef.Execute
oCtrlDef = ThisApplication.CommandManager.ControlDefinitions.Item("AppRepeatCmd")
oCtrlDef.Execute

'Clears Plot Stamp Values
'iProperties.Value("Custom", "plotstamp") = ""
'iProperties.Value("Custom", "Projektpfad") = ""

 

 

0 Likes
Accepted solutions (1)
1,047 Views
18 Replies
Replies (18)
Message 2 of 19

chandra.shekar.g
Autodesk Support
Autodesk Support

@autodeskplusplanung,

 

Can you please provide non confidential external iLogic code and reproducible steps to study?

iLogicVb.RunExternalRule("Rahmen_mit_Druckdatum")

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 19

autodeskplusplanung
Enthusiast
Enthusiast

This is the external rule that picks the border

'This declares a template to pull drawing resources from
ThisDrawing.ResourceFileName = "C:\01_Inventor\01_Vorlagen\Zeichnung_PP.idw"

'This is a loop that replaces the border on all sheets
NoSheets = ThisApplication.ActiveDocument.Sheets.Count

For i = 1 To NoSheets

ThisSheet = "Blatt:" & i

ActiveSheet = ThisDrawing.Sheet(ThisSheet)
ActiveSheet.Border = "Normrahmen PP mit Plotstamp"

Next i

 I added the template and a pdf-print with different formats

0 Likes
Message 4 of 19

chandra.shekar.g
Autodesk Support
Autodesk Support

@autodeskplusplanung,

 

Do you have individual sheet borders? In the external iLogic rule, "Normrahmen PP mit Plotstamp" border is only used to activate the border.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 5 of 19

bradeneuropeArthur
Mentor
Mentor
'This sets the Custom iProperties to the appropriate values
Name= ThisApplication.GeneralOptions.UserName
PSDate = Format(Now, "dd/MMM/yy")'Now.ToShortDateString
PSTime = Format(Now, "hh/mm/ss") 'Now.ToShortTimeString
Pfad = ThisDoc.WorkspacePath
Datei = ThisDoc.FileName(True) 'with extension

'Exteranal Rule to Run on Legacy Border
ActiveBorder = ActiveSheet.Border
If ActiveBorder <> "Normrahmen PP mit Plotstamp" Then
	iLogicVb.RunExternalRule("Rahmen_mit_Druckdatum")
End If

iProperties.Value("Custom", "PlotStamp") = "|" & Name & ", " & PSDate & ", " & PSTime
iProperties.Value("Custom", "Projektpfad") = Pfad & "\" & Datei

InventorVb.DocumentUpdate()

'Printing Commands
Dim oCtrlDef As ControlDefinition
oCtrlDef = ThisApplication.CommandManager.ControlDefinitions.Item("AppFileExportPDFCmd")'AppGetStartCmd
oCtrlDef.Execute
oCtrlDef = ThisApplication.CommandManager.ControlDefinitions.Item("AppRepeatCmd")
oCtrlDef.Execute

'Clears Plot Stamp Values
'iProperties.Value("Custom", "plotstamp") = ""
'iProperties.Value("Custom", "Projektpfad") = ""

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 6 of 19

autodeskplusplanung
Enthusiast
Enthusiast

Good morning

I stitch this rules together with great help of this forum. I'm not an expert. But the idea is, that when I start the first rule it also starts the other rule, which looks if the border with the plotstamp is in the drawing. It should look into the template, pick up the rule a place it into the drawing, then place all the info into the ipros and the export as a pdf.

So far it works fine. But if I have different sheet formats and I export all the sheets at once. It places the border in the size of the active sheet on all sheets. So I get a border A3 size on a A1 sheet.

0 Likes
Message 7 of 19

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Did you have taken a look at the other method of formatting the date and time?

 

PSDate = Format(Now, "dd/MMM/yy")
PSTime = Format(Now, "hh/mm/ss") 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 8 of 19

autodeskplusplanung
Enthusiast
Enthusiast

Hi Arthur

Not yet, but you think the format of the date has something to do with the size of the border?

0 Likes
Message 9 of 19

bradeneuropeArthur
Mentor
Mentor

No it isn't!

The additional rule is not available for us!

So I think this rule is the case!

 

Please upload the rule...

 

Regards,

 

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 10 of 19

autodeskplusplanung
Enthusiast
Enthusiast

Ok, ok

Here are the rules (again 😉 )

This is the "print pdf rule"

'This sets the Custom iProperties to the appropriate values
Name= ThisApplication.GeneralOptions.UserName
PSDate = Now.ToShortDateString
PSTime = Now.ToShortTimeString
Pfad = ThisDoc.WorkspacePath
Datei = ThisDoc.FileName(True) 'with extension

'Exteranal Rule to Run on Legacy Border
ActiveBorder = ActiveSheet.Border
If ActiveBorder <> "Normrahmen PP mit Plotstamp" Then
	iLogicVb.RunExternalRule("Rahmen_mit_Druckdatum")
End If

iProperties.Value("Custom", "PlotStamp") = "|" & Name & ", " & PSDate & ", " & PSTime
iProperties.Value("Custom", "Projektpfad") = Pfad & "\" & Datei

InventorVb.DocumentUpdate()

'Printing Commands
Dim oCtrlDef As ControlDefinition
oCtrlDef = ThisApplication.CommandManager.ControlDefinitions.Item("AppFileExportPDFCmd")'AppGetStartCmd
oCtrlDef.Execute
oCtrlDef = ThisApplication.CommandManager.ControlDefinitions.Item("AppRepeatCmd")
oCtrlDef.Execute

'Clears Plot Stamp Values
'iProperties.Value("Custom", "plotstamp") = ""
'iProperties.Value("Custom", "Projektpfad") = ""

And this is the rule "pick  the border"   <Rahmen_mit_Druckdatum.iLogicVb>

'This declares a template to pull drawing resources from
ThisDrawing.ResourceFileName = "C:\01_Inventor\01_Vorlagen\Zeichnung_PP.idw"

'This is a loop that replaces the border on all sheets
NoSheets = ThisApplication.ActiveDocument.Sheets.Count

For i = 1 To NoSheets

ThisSheet = "Blatt:" & i

ActiveSheet = ThisDrawing.Sheet(ThisSheet)
ActiveSheet.Border = "Normrahmen PP mit Plotstamp"

Next i

 I added the template with the border as well

0 Likes
Message 11 of 19

autodeskplusplanung
Enthusiast
Enthusiast

Hi

I would like to bring this problem up. I still don't have an answer.

Does anybody have a suggestion to solve this problem?

0 Likes
Message 12 of 19

autodeskplusplanung
Enthusiast
Enthusiast

Hi

I try it again. Sorry. But it is an annoying problem. And I'm a bit frustrated.

I had some response in the forum. I provided the codes and now nothing 🙂

Is there no clue to the problem or is it something else?

Please let me know

0 Likes
Message 13 of 19

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Think that I misunderstood your problem.

The problem you may have has to do with the fact that your border is changing but not your Border Format.

The Border format A1 A2 A3 etc. is defined in the sheet and has nothing to do with the dimensions or layout.

If you change the dimensions of the format A1 large and A1 small, you need also change the Header format, under circumstances. Otherwise you will have problems with the insertion-point of the Header in combination with the Border...

 

If you have questions, please let me know.

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 14 of 19

autodeskplusplanung
Enthusiast
Enthusiast

Hi Arthur

Thanks for joining me again. I appreciate that.

I have no clue what you mean with the header format. But I made a screencast to show my problem. It is a bit sloppy, sorry. Hope it brings some light into that issue. 

 

0 Likes
Message 15 of 19

bradeneuropeArthur
Mentor
Mentor
Accepted solution

Hi,

 

The drawing header you use has an insertion-point. if this is used in a different sheet format then this is will lead into problems when used in a different format. it will move unexpected to the insertion point. if correctly formated this will be no problem. take a look at the header sketch you are using and the insertion point defenitions.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 16 of 19

autodeskplusplanung
Enthusiast
Enthusiast

Hi

Now I think I got it. It seems, my Titelblock is to sloppy with fixed constrains. And that seems to mix up the border.

Will test further and fix the titelblock.

@ Arthur, with header do you mean the titelblock or is that something else?

0 Likes
Message 17 of 19

bradeneuropeArthur
Mentor
Mentor

Correct!

 

Titleblock is the correct word for inventor!!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 18 of 19

autodeskplusplanung
Enthusiast
Enthusiast

Hi Arthur

Thanks for your help, have a nice weekend

0 Likes
Message 19 of 19

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Your thanks are appreciated.

Have a nice day!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes