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,
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?
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?
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
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.