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

    Autodesk Inventor

    Reply
    Employee
    Posts: 932
    Registered: ‎02-24-2009

    Re: Changing C/C component Automation

    03-20-2012 10:14 AM in reply to: cean_au

    Cean,


     Here is a new version of the content center rule.  It has a new option to place a part with custom parameters as a Standard part.  The sample rule (AddContentCenterBar.txt) has a new line of code:
    replacer.CreationMode = FileCreationMode.AsStandard

    (Other options available are:
    replacer.CreationMode = FileCreationMode.AsCustom

    replacer.CreationMode = FileCreationMode.ByFunctionName  '  this is the default.  )

     I modified the sample code to work with the content center family that you are looking at.  This family uses a different custom parameter (B_L) to set the length (as compared to the pipe which uses PL).
     To see the parameter name, place a component manually and look at the Table View.  Hover the mouse over the column header to see the internal name of the column.  This is the parameter name that is required for the code.

    ContentCenterColumnName.png



    Mike Deck
    Software Developer
    DLS - Mechanical Design
    Autodesk, Inc.

    Please use plain text.
    Employee
    Posts: 932
    Registered: ‎02-24-2009

    Re: Changing C/C component Automation

    03-20-2012 11:17 AM in reply to: MjDeck

    Note that I changed the sample code to use a parameter named BarLength (it was previously PipeLength).



    Mike Deck
    Software Developer
    DLS - Mechanical Design
    Autodesk, Inc.

    Please use plain text.
    Distinguished Contributor
    JimSteinmeyer
    Posts: 326
    Registered: ‎05-16-2011

    Re: Changing C/C component Automation

    03-20-2012 12:31 PM in reply to: josephcooley

    Mike,

    You asked Cean if he wanted the part as stancard or custom. Can you explane the differences and an example of use for each?

     

    Thank you

     

    Jim

    Jim

    Inventor Premium 2013 SP1.1
    Vault 2013- plain vanilla version
    HP G71 notebook
    celeron cpu w\ 4gb RAM and 64 bit system
    Win 7 home premium

    Ya, my boss has me running my personal machine at work.
    Please use plain text.
    Valued Contributor
    cean_au
    Posts: 99
    Registered: ‎07-11-2011

    Re: Changing C/C component Automation

    03-20-2012 05:22 PM in reply to: MjDeck

    Hi Mike,

     

    All good for custom part now. The flat bar is also good for standard, no matter I use "PL" or "B_L", or even omit it.

    But the pipe still can't show correct length when placed as standard part.

     

    Thanks

     

    Cean

     

    HI Jim, one difference is they are saved in different folders. Standard parts sit in content center. Custom ones sit in your project folder.

    Please use plain text.
    Employee
    Posts: 932
    Registered: ‎02-24-2009

    Re: Changing C/C component Automation

    03-20-2012 05:34 PM in reply to: cean_au

    Cean,
     Can you post your complete rule that demostrates the failure to set the length of the pipe component?  Please attach it as a text file.  That makes it easy for me to work with it.



    Mike Deck
    Software Developer
    DLS - Mechanical Design
    Autodesk, Inc.

    Please use plain text.
    Valued Contributor
    cean_au
    Posts: 99
    Registered: ‎07-11-2011

    Re: Changing C/C component Automation

    03-20-2012 07:19 PM in reply to: MjDeck

    Here it is. Thx

    Please use plain text.
    Employee
    Posts: 932
    Registered: ‎02-24-2009

    Re: Changing C/C component Automation

    03-20-2012 07:44 PM in reply to: cean_au

    Cean,
     Your rule works on my system.  It creates a pipe with length PL = 200 in.
     On your system, you might have to manually delete old pipe parts in your Content Center directory.  The old version of the rule probably created parts with the wrong length.  The new version won't overwrite these: it doesn't know that they are obsolete.  Once you delete them, the rule can generate new versions.

     I think an old part would also explain the behavior you saw with the bar part.  When you use "PL" instead of "B_L" for the bar part: if the part with that name already exists, it won't try to regenerate it.  If it did, you would see that "B_L" is required.  Please try deleting your existing bar parts (only delete the recently generated ones: don't delete any that are being used in other assemblies) and generate new ones.  I'm pretty sure that you will find that "B_L" is required to set the length of the bar part.



    Mike Deck
    Software Developer
    DLS - Mechanical Design
    Autodesk, Inc.

    Please use plain text.
    Valued Contributor
    cean_au
    Posts: 99
    Registered: ‎07-11-2011

    Re: Changing C/C component Automation

    03-20-2012 08:16 PM in reply to: MjDeck

    Hi Mike,

     

    Cleaned the folders and all right now. The code is so cool now.

     

    Thanks for all the help.

     

    Cean

    Please use plain text.
    Distinguished Contributor
    Posts: 224
    Registered: ‎12-14-2008

    Re: Changing C/C component Automation

    06-08-2012 01:04 AM in reply to: s.cupples

    Hello

     

    Could you please show a line of code which will swap content centre nuts?

     

    also posted:

    http://forums.autodesk.com/t5/Autodesk-Inventor/iLogic-Content-Center-Replace-Nuts/td-p/3489692

     

    Many Thanks

     

    MES

    Please use plain text.
    Employee
    Posts: 932
    Registered: ‎02-24-2009

    Re: Changing C/C component Automation

    06-15-2012 01:35 PM in reply to: MjDeck

    Mark,

     See the sample rule in the attached file SwapNut.txt.  It will select a different member row within a family.  With modifications, it could select a different family.  To make it work in an assembly, you need to change the name of the nut component (the component name in the Model browser, not the file name) to "Ansi B18.2.4.2M Nut:1".  Also, create a Text parameter named NutType.  Make it a multi-value parameter, with possible values:
    M3x0.5
    M4x0.7
    M5x0.8

     



    Mike Deck
    Software Developer
    DLS - Mechanical Design
    Autodesk, Inc.

    Please use plain text.