• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Inventor Customization

    Reply
    Valued Contributor
    Posts: 60
    Registered: ‎09-30-2005

    Ilogic: Reposition revision table on sheet size change chanllange!

    264 Views, 3 Replies
    09-24-2012 06:36 AM

    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,

    Please use plain text.
    ADN Support Specialist
    Posts: 167
    Registered: ‎08-14-2012

    Re: Ilogic: Reposition revision table on sheet size change chanllange!

    09-26-2012 11:43 PM 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

    Please use plain text.
    Valued Contributor
    Posts: 60
    Registered: ‎09-30-2005

    Re: Ilogic: Reposition revision table on sheet size change chanllange!

    09-27-2012 02:28 AM 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? 

    Please use plain text.
    ADN Support Specialist
    xiaodong.liang
    Posts: 814
    Registered: ‎06-12-2011

    Re: Ilogic: Reposition revision table on sheet size change chanllange!

    10-11-2012 11:23 PM 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
    

     



    Xiaodong Liang
    Developer Technical Services
    Autodesk Developer Network

    Please use plain text.