Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ilogic: Reposition revision table on sheet size change chanllange!

4 REPLIES 4
Reply
Message 1 of 5
theo.bot
2241 Views, 4 Replies

Ilogic: Reposition revision table on sheet size change chanllange!

Hi there,

 

a customer has a title block with a revision table ( standard vault revision table)  add on top of it.

If you change the sheet size the revision table remains his position.

 

If found the way to reposition the table with a ilogic rule.:

 

 

'point afstand in cm
PointX=(ActiveSheet.Width/10)-13
PointY=5.5
'punt vanaf rechtonder gemeten in cm

DimoPointAsPoint2d
oPoint=ThisApplication.TransientGeometry.Createpoint2d(PointX,PointY)
'her positioneel revisiontable
ActiveSheet.Sheet.RevisionTables.Item(1).Position=oPoint

InventorVb.DocumentUpdate()

This is working perfectly.

 

But now the challange how to trigger this rule to run if you change the sheet size?

 

if tried:

 

trigger=Activesheet.size

 

or

 

to create a userparameter and added this line in my rule : Size=ActiveSheet.size, normaly is you change parameters it triggers the rule to rule.

 

but both way didn't work.

 

Can event triggers from the API be used?  Do i need the "Onchange" event?

Can anyone give an example for a ilogic rule?

 

Kind regards,

4 REPLIES 4
Message 2 of 5
Vladimir.Ananyev
in reply to: theo.bot

Is Before Save Document event acceptable in your case?  This is not exactly that you asked but... you should periodically save your drawings, shouldn't you?

Rule_Triggered_by_Events_Dialog.jpg

 


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 3 of 5
theo.bot
in reply to: Vladimir.Ananyev

I know that i can use the before save and it would work.

 

But it would  be nice to trigger the rule when changing the sheet size. so it save's extra actions.

 

So is it possible or not to use a api event trigger in a ilogic rule? 

Message 4 of 5
xiaodong_liang
in reply to: theo.bot

Hi,

 

It looks to me the only way is to start OnChange event by Inventor API, and execute the iLogic rule, as you have thought of. Following is a small piece on how to call a rule in Inventor API.

 

 

 'Iterates through Inventor Add-Ins collection 
For Each oAddIn As ApplicationAddIn In InventorApplication.ApplicationAddIns 
'Looks for iLogic Addin CLSID; Note this GUID is AddIn specific, you will need to insert your own AddIn's ClassID! 
If (oAddIn.ClassIdString = "{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}") Then 
'Calls Automation property 
Dim oAddInInterface As IiLogicAutomation = CType(oAddIn.Automation, IiLogicAutomation) 
'Calls Execute Method of IiLogicAutomation 
Dim oRule As iLogicRule = oAddInInterface.GetRule(InventorApplication.ActiveDocument, "Test") 
Exit For 
End If 
Next

 

Message 5 of 5

Is there a way to add a rotation by angle to this code prior to inserting the rev table?

 

I cant seem to figure a way of doing this. 

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

Post to forums  

Autodesk Design & Make Report