Where is my parameter used?

Where is my parameter used?

DavidTruyens
Advocate Advocate
797 Views
5 Replies
Message 1 of 6

Where is my parameter used?

DavidTruyens
Advocate
Advocate

When you hover over a parameter you can see where it's used. This is something I would like to find out via the API. Any suggestions?

 

Thanks,

David

param.PNG

 



David Truyens
Technical Specialist
Twitter | LinkedIn | IDCM | GitHub

0 Likes
798 Views
5 Replies
Replies (5)
Message 2 of 6

DavidTruyens
Advocate
Advocate

I was a bit too fast, it's here: Parameter.Dependents...



David Truyens
Technical Specialist
Twitter | LinkedIn | IDCM | GitHub

0 Likes
Message 3 of 6

dgreatice
Collaborator
Collaborator

Hi

 

ModelParameter Object

DependentsProperty that returns the collection of objects that have a direct dependency on the parameter.

 

Like @JaneFan Said

"Sorry for the inconvenience.

There is an issue here: Dependents of user parameters can return correctly, while that of model parameter returns blank object collection even there should be something in there. It has been tracked in our issue system."

 

at :

https://forums.autodesk.com/t5/inventor-customization/get-the-sketch-name-consumed-by-all-parameters...

 

i think it will same issue at assembly parameters to get consume parameter from what constraints.

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes
Message 4 of 6

cencinaNB2ET
Advocate
Advocate
0 Likes
Message 5 of 6

dgreatice
Collaborator
Collaborator

Hi,

 

I have new info for this issue, maybe it you solution.

 

try this, I have example for indetify In Use in Part Document

 

Public Sub IdentifyParameterUseIn()
    Dim app As Application
    Set app = ThisApplication
   
    Dim oPD As PartDocument
    Set oPD = app.ActiveDocument
   
    Dim oPCD As PartComponentDefinition
    Set oPCD = oPD.ComponentDefinition
   
    Dim oParam As Parameters
    Set oParam = oPCD.Parameters
   
    Dim oMP As ModelParameter
    Dim oSkt As Sketch
    Dim ParentCompDef As PartComponentDefinition
    Dim oFeat As PartFeature
    Dim oFeatParam As Parameter
   
    Dim DimCon As DimensionConstraints
    Dim SktParam As DimensionConstraint
   
    'call Model Parameter
    For Each oMP In oParam.ModelParameters
        'call parent of model parameter
        Set ParentCompDef = oMP.Parent.ComponentDefinition
        For Each oSkt In ParentCompDef.Sketches
            Set DimCon = oSkt.DimensionConstraints
            For Each SktParam In DimCon
                If SktParam.Parameter.Name = oMP.Name Then
                    MsgBox "Parameter Name " & oMP.Name & " is Consumed By " & oSkt.Name
                End If
            Next
        Next
        For Each oFeat In ParentCompDef.Features
            For Each oFeatParam In oFeat.Parameters
                If oFeatParam.Name = oMP.Name Then
                    MsgBox "Parameter Name " & oMP.Name & " is Consumed By " & oFeat.Name
                End If
            Next
        Next
    Next
   
End Sub

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
Message 6 of 6

Anonymous
Not applicable

Hello @dgreatice 

 

is it possible to extend this to include parameters consumed by offset planes? 

 

 

Cheers,

Omar

0 Likes