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

    Autodesk Inventor Customization

    Reply
    Mentor
    Posts: 174
    Registered: ‎11-22-2009

    changing derived parameters

    388 Views, 5 Replies
    09-05-2010 11:49 AM

    hello

     

    Can anyone tell me why this Code does nothing? I suggest, that the Parameter will not longer be derived.

     

    Private Sub UnlinkDerivedPrameter()
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument

    Dim oDPC As DerivedPartComponent
    Set oDPC = oDoc.ComponentDefinition.Features.ReferenceFeatures.Item(1).ReferenceComponent

    oDPC.Definition.Parameters.Item(1).IncludeEntity = False

    End Sub

    Please use plain text.
    Contributor
    Posts: 15
    Registered: ‎10-22-2009

    Re: changing derived parameters

    09-16-2010 11:54 AM in reply to: krieg

    Hi krieg,

    Did you find a solution to this?

    I'm also working with derived parameters.

     

    Feel free to email me at:

    sdiaz at structurecraft dot com

     

    Cheers,

     

    Santiago

    Please use plain text.
    Employee
    Posts: 84
    Registered: ‎11-13-2007

    Re: changing derived parameters

    09-16-2010 03:47 PM in reply to: krieg

    The definition obtained from the component is a tear-off and does not maintain a live link. You need to set the modified definition back to the component. Something like this...

     

    Private Sub UnlinkDerivedPrameter()
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oDPC As DerivedPartComponent
    Set oDPC = oDoc.ComponentDefinition.Features.ReferenceFeatures.Item(1).ReferenceComponent
    
    Dim oDPD As DerivedPartDefinition
    Set oDPD = oDPC.Definition
    
    oDPD.Parameters.Item(1).IncludeEntity = False
    
    oDPC.Definition = oDPD
    
    End Sub

     

    Please use plain text.
    Mentor
    Posts: 174
    Registered: ‎11-22-2009

    Re: changing derived parameters

    09-17-2010 02:22 AM in reply to: sanjay.ramaswamy

    Hello

     

    Once again, a perfect answer to my question. Thanks a lot Sanjay. :-)

    Please use plain text.
    Contributor
    Posts: 15
    Registered: ‎10-22-2009

    Re: changing derived parameters

    09-17-2010 07:41 PM in reply to: krieg

    Thanks Sanjay!

    Please use plain text.
    Mentor
    Posts: 565
    Registered: ‎10-22-2007

    Re: changing derived parameters

    04-04-2011 05:39 AM in reply to: krieg

    Hi Sanjay

     

    This allows you to remove the derived parameter. How do you include a dervied parameter?

     

    Thanks

    Paul

    Please use plain text.