Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Run rule when sheet size is changed

4 REPLIES 4
Reply
Message 1 of 5
fakeru
1169 Views, 4 Replies

Run rule when sheet size is changed

Hi!

I have created a rule that will replace the border sheet when the sheet size will be changed, so users won't have to do it manually.

The problem is that the rule won't run when the sheet size is changed. I find that events for triggering the rules are rather few under drawing enviroment.

I thought to use "iProperty Change" event, providing I assign the SheetSize to a Custom iProperty, but the iProperty won't update automatically as well.

 

Any ideas what could help?

 

Regards

Alexandru

 

Autodesk Inventor 2015 Certified Professional
4 REPLIES 4
Message 2 of 5
fakeru
in reply to: fakeru

Nothing? 😞
Autodesk Inventor 2015 Certified Professional
Message 3 of 5
jletcher
in reply to: fakeru

posting your code would help.

 

 Also if you post ilogic or VBA questions in the Inventor Customization would get more answers.

 

 I have an ilogic rule that changes sheet size, title block and border works when new document is started.

 

 Where do you have your trigger set where is it in your code all this will be needed before anyone can help.

Message 4 of 5
fakeru
in reply to: jletcher

Here is the code:

kLandscapePageOrientation = 10242
kPortraitPageOrientation = 10243
CurrentOrientation = ThisApplication.ActiveDocument.ActiveSheet.Orientation

If ActiveSheet.Size = "A4" And CurrentOrientation = 10243 Then
ActiveSheet.Border = "A4 Portrait"
End If

'A3 Portrait
If ActiveSheet.Size = "A3" And CurrentOrientation = 10243 Then
ActiveSheet.Border = "A3 Portrait"
End If

'A3 Landscape
If ActiveSheet.Size = "A3" And CurrentOrientation = 10242 Then
ActiveSheet.Border = "A3 Landscape"
End If

'A2 Portrait
If ActiveSheet.Size = "A2" And CurrentOrientation = 10243 Then
ActiveSheet.Border = "A2 Portrait"
End If

'A2 Landscape
If ActiveSheet.Size = "A2" And CurrentOrientation = 10242 Then
ActiveSheet.Border = "A2 Landscape"
End If

'A1 Portrait
If ActiveSheet.Size = "A1" And CurrentOrientation = 10243 Then
ActiveSheet.Border = "A1 Portrait"
End If

'A1 Landscape
If ActiveSheet.Size = "A1" And CurrentOrientation = 10242 Then
ActiveSheet.Border = "A1 Landscape"
End If

'A0 Portrait
If ActiveSheet.Size = "A0" And CurrentOrientation = 10243 Then
ActiveSheet.Border = "A0 Portrait"
End If

'A0 Landscape
If ActiveSheet.Size = "A0" And CurrentOrientation = 10242 Then
ActiveSheet.Border = "A0 Landscape"
End If

 I can run it with itrigger, but that's not the idea, because other users don't use ilogic. I have lots of ilogic rules in different inventor files that other users don't even know about them, those rules run in background without interacting with the designers.. Most of them won't like the idea of pressing a button (itrigger), they are not used with ilogic things. I just want it to be automatically done by Inventor.

Autodesk Inventor 2015 Certified Professional
Message 5 of 5
jletcher
in reply to: fakeru

The trigger is silent they will be prompt at the start and they will pick option the tigger makes it happen but they don't have to do anything but pick.

 

Make it ask them when new template is used.

 

 My code is not what you are after but you may get the idea. My ilogic is used to ask what sheet size to use all are in landscape and also changes the styles.

 

 But you may get the idea what to do.

 

In the fx you will make a list of options..

 

pick.JPG

 

 

 

trigger=iTrigger0

Dim drawingDoc as DrawingDocument = ThisDoc.Document
Dim stylesMan As DrawingStylesManager = drawingDoc.StylesManager
Trace.WriteLine(" --- Active drawing standard = " & stylesMan.ActiveStandardStyle.Name )

'Pick Sheet Size
Sheet_Size= InputListBox("Select Sheet Size", MultiValue.List("Sheet_Size"), Sheet_Size, Title := "Sheet Size", ListName := "Choose Sheet Size")

'A size
If Sheet_Size = "A (8 1/2 X 11)" Then
ActiveSheet.ChangeSize("A", MoveBorderItems := True)
ActiveSheet.TitleBlock = "your info"
ActiveSheet.Border = "your info"
stylesMan.ActiveStandardStyle = stylesMan.StandardStyles("your info")

'B size
ElseIf Sheet_Size = "B (11 X 17)" Then 
ActiveSheet.ChangeSize("B", MoveBorderItems := True)
ActiveSheet.TitleBlock = "your info"
ActiveSheet.Border = "your info"
stylesMan.ActiveStandardStyle = stylesMan.StandardStyles("your info")

'C size
ElseIf Sheet_Size = "C (17 X 22)" Then 
ActiveSheet.ChangeSize("C", MoveBorderItems := True)
ActiveSheet.TitleBlock = "your info"
ActiveSheet.Border = "your info"
stylesMan.ActiveStandardStyle = stylesMan.StandardStyles("your info")

'D size
ElseIf Sheet_Size = "D (22 X 34)" Then 
ActiveSheet.ChangeSize("D", MoveBorderItems := True)
ActiveSheet.TitleBlock = "your info"
ActiveSheet.Border = "your info"
stylesMan.ActiveStandardStyle = stylesMan.StandardStyles("your info")

'E size
ElseIf Sheet_Size = "E (34 X 44)" Then 
ActiveSheet.ChangeSize("E", MoveBorderItems := True)
ActiveSheet.TitleBlock = "your info"
ActiveSheet.Border = "your info"
stylesMan.ActiveStandardStyle = stylesMan.StandardStyles("your info")

End If
Trace.WriteLine(" --- Active drawing standard = " & stylesMan.ActiveStandardStyle.Name )
'update all 
InventorVb.DocumentUpdate()
'zoom all
ThisApplication.ActiveView.Fit

 

 

 fx.JPG

 

 

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report