Inventor 2015 iLogic Sheet Properties

Inventor 2015 iLogic Sheet Properties

Anonymous
Not applicable
1,678 Views
17 Replies
Message 1 of 18

Inventor 2015 iLogic Sheet Properties

Anonymous
Not applicable

Hi all,

I am having some issues solving a problem which I have been racking my brain over for almost a year with nothing to show for it.

I am trying to create an iLogic script to either directly edit the "Sheet Revision" property or open a form where it can be modified. I use this property in my Title Blocks as we do per-sheet revisions of our drawings.

edit.PNGrevision.PNG

I have tried playing with the Drawing and Advanced Drawing API functions, but have had no luck finding the correct iLogic code to access the property.

I already use an iLogic form that triggers on "New Drawing" to input the drawing number, author, etc. iProperties we use in our Title Blocks, but these exist on a per-drawing not a per-sheet basis. For the per-sheet data we use Prompted Entry normally, however I am stubborn and want to set the Sheet Revision number using the property.

 

On another note, does anyone know how to get an iLogic rule to run when the active sheet changes?

 

Thanks in advance for your responses,

Erik

0 Likes
1,679 Views
17 Replies
Replies (17)
Message 2 of 18

Mark.Lancaster
Consultant
Consultant

@Anonymous

 

iLogic programming questions and issue should be posted in the Inventor Customization forum to receive the best results.  I will have the moderator relocate your posting there to best suit your needs.

 

https://forums.autodesk.com/t5/inventor-customization/bd-p/120

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

0 Likes
Message 3 of 18

dgreatice
Collaborator
Collaborator

Hi,

 

try this :

SheetRev = InputBox("Input Sheet Revision", "Sheet Revision", ActiveSheet.Sheet.Revision)
ActiveSheet.Sheet.Revision = SheetRev

 

 

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes
Message 4 of 18

Anonymous
Not applicable

No dice. Spits out the following error:

Error in rule: Revision, in document: test.idw

Public member 'Revision' on type 'Sheet' not found.
0 Likes
Message 5 of 18

dgreatice
Collaborator
Collaborator

ok, lets modify that code:

 

 

Dim oDD As DrawingDocument
Dim oSht As Sheet

oDD = ThisApplication.ActiveDocument
oSht = oDD.ActiveSheet
SheetRev = InputBox("Input Sheet Revision", "Sheet Revision", oSht.Revision)
oSht.Revision = SheetRev

 

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
Message 6 of 18

Anonymous
Not applicable

Same error. Inventor 2015 doesn't seem to be seeing the 'Revision' parameter attached to the sheet object.

0 Likes
Message 7 of 18

dgreatice
Collaborator
Collaborator

can you check using VBA inside inventor 2015?

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes
Message 8 of 18

Anonymous
Not applicable

This is how it is configured:

revision.PNG

It is now producing this error:

error.PNG

0 Likes
Message 9 of 18

Anonymous
Not applicable

Sorry, misread you previous reply. I haven't used VBA in Inventor before.

Am i just running your code as a macro? Or am I completely oblivious to something obvious?

0 Likes
Message 10 of 18

dgreatice
Collaborator
Collaborator

Uncheck list Straight VB Code.

 

try to run rule again

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes
Message 11 of 18

Anonymous
Not applicable

Both of the posted codes work in Inventor Pro 2018 (Student Version), but neither worked in 2015 (with Straight VB code enabled or disabled)

I was getting both the same error as before, and another error about improper declaration.

0 Likes
Message 12 of 18

bradeneuropeArthur
Mentor
Mentor
Dim oDD As inventor.DrawingDocument
Dim oSht As inventor.Sheet

oDD = ThisApplication.ActiveDocument
oSht = oDD.ActiveSheet
Dim SheetRev as String
SheetRev = InputBox("Input Sheet Revision", "Sheet Revision", oSht.Revision)


oSht.Revision = SheetRev

For VBA:

Public Sub nn()

Dim oDD As Inventor.DrawingDocument
Dim oSht As Inventor.Sheet

Set oDD = ThisApplication.ActiveDocument
Set oSht = oDD.ActiveSheet
Dim SheetRev As String
SheetRev = InputBox("Input Sheet Revision", "Sheet Revision", oSht.Revision)

oSht.Revision = SheetRev

End Sub

 

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 13 of 18

Anonymous
Not applicable

Still puts out the following error in 2015:

System.MissingMemberException: Public member 'Revision' on type 'Sheet' not found.
   at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
   at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
   at LmiRuleScript.Main()
   at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
   at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

Yet, it works in 2018...

 

And trying in VBA:

error.PNG

0 Likes
Message 14 of 18

bradeneuropeArthur
Mentor
Mentor

try this:

for I-logic:

Public Sub nn()

Dim oDD As Inventor.DrawingDocument
Dim oSht As Inventor.Sheet

oDD = ThisApplication.ActiveDocument
oSht = oDD.ActiveSheet
Dim SheetRev As String
SheetRev = InputBox("Input Sheet Revision", "Sheet Revision")

oSht.Revision = SheetRev

End Sub

for Vba:

 
Public Sub nn()

Dim oDD As Inventor.DrawingDocument
Dim oSht As Inventor.Sheet

Set oDD = ThisApplication.ActiveDocument
Set oSht = oDD.ActiveSheet
Dim SheetRev As String
SheetRev = InputBox("Input Sheet Revision", "Sheet Revision")

oSht.Revision = SheetRev

End Sub

Are you getting the inputbox now?

Regards,

Autodesk Software: Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018
Programming Skills: Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
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 !

 

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 15 of 18

Anonymous
Not applicable

Had to change the sub name to main, but the input box now shows, but the same error still shows after closing the dialogue:

Public member 'Revision' on type 'Sheet' not found.

System.MissingMemberException: Public member 'Revision' on type 'Sheet' not found.
   at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateSet(Object o, Type& objType, String name, Object[] args, String[] paramnames, Boolean OptimisticSet, CallType UseCallType)
   at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean OptimisticSet, Boolean RValueBase, CallType CallType)
   at LmiRuleScript.Main()
   at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
   at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

 When trying in VBA the input box shows then is throws this error:

error.PNG

0 Likes
Message 16 of 18

bradeneuropeArthur
Mentor
Mentor

Have you set all references correctly for VBA:

VBA references.PNG

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 17 of 18

Anonymous
Not applicable

Yes, the references are set.

ref.PNG

0 Likes
Message 18 of 18

mseveroLXMQ8
Participant
Participant
Works great!
0 Likes