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

    Autodesk Inventor Customization

    Reply
    Active Contributor
    Posts: 26
    Registered: ‎10-10-2009
    Accepted Solution

    Editing a component in an assembly.

    109 Views, 6 Replies
    03-29-2012 01:18 PM

    I'm working on an iLogic application for an assembly. I need some code to edit a particular component occurrence and then open one of that component's iLogic forms.

    Basically automating the keystrokes that I'm doing manually (Select, right-click and edit, then open the iLogic formfor that part).

    Do I have to scroll thru all occurrences in the browser or is there a way to call that component by name? 

    Please use plain text.
    Mentor
    mehatfie
    Posts: 163
    Registered: ‎02-10-2012

    Re: Editing a component in an assembly.

    03-29-2012 09:24 PM in reply to: tclayton
    You can call the specific component by name. I will give you the code to do so in the morning
    Please use plain text.
    Mentor
    mehatfie
    Posts: 163
    Registered: ‎02-10-2012

    Re: Editing a component in an assembly.

    03-30-2012 06:59 AM in reply to: tclayton

    DocOpen = ThisApplication.Documents.Open("Component Name Here", True)

     

    The true at the end sets this document as the active one

     

    Cheers

    Mitch

    Please use plain text.
    Mentor
    mehatfie
    Posts: 163
    Registered: ‎02-10-2012

    Re: Editing a component in an assembly.

    03-30-2012 11:36 AM in reply to: mehatfie

    DocOpen = ThisApplication.Documents.Open("Component Path and File Name Here", True)

    Please use plain text.
    Active Contributor
    Posts: 26
    Registered: ‎10-10-2009

    Re: Editing a component in an assembly.

    03-30-2012 01:01 PM in reply to: mehatfie

    Wont that code just open the part file in a new window?

    I want to edit the component from with in the assembly file.

    (Select component , right click and select edit)

    Please use plain text.
    Mentor
    mehatfie
    Posts: 163
    Registered: ‎02-10-2012

    Re: Editing a component in an assembly.

    03-30-2012 01:13 PM in reply to: tclayton

    Ok sorry, I did not realize you wanted to edit within the assembly. I only assumed you wanted to edit the part. In that case I am unsure

     

    Mitch

    Please use plain text.
    Active Contributor
    Posts: 26
    Registered: ‎10-10-2009

    Re: Editing a component in an assembly.

    04-07-2012 03:35 PM in reply to: mehatfie

    Figured it out

     

     

    DimoAssyDocAsAssemblyDocument=ThisApplication.ActiveDocument     DimoAssyCompDefAsComponentDefinition=oAssyDoc.ComponentDefinition     DimoCompOccAsComponentOccurrence=oAssyCompDef.Occurrences.ItemByName("V-BLOCK:1")         oCompOcc.Edit

     

    Please use plain text.