Is there a way to find out where a parameter is used?

Is there a way to find out where a parameter is used?

hoegge
Collaborator Collaborator
5,175 Views
22 Replies
Message 1 of 23

Is there a way to find out where a parameter is used?

hoegge
Collaborator
Collaborator

It would be very useful to be able to find all the places a parameter is used. Is there a way and if not it would be great to implement it.

Accepted solutions (1)
5,176 Views
22 Replies
Replies (22)
Message 2 of 23

TrippyLighting
Consultant
Consultant

Only by painfully manually searching throug all the parameters in the User Parameter UI.

 

I personally find it incomprehensible that there is no search function available in that UI or in the browser.


EESignature

Message 3 of 23

twitos
Enthusiast
Enthusiast

I'd like to second the request to have the ability to search WHERE, in the various sketches and features, a given parameter is used (similar to what is done in Excel). 

 

Message 4 of 23

etfrench
Mentor
Mentor

You can export the parameters to a .csv file using the Parameter I/O addin where they can be easily searched with Excel.

ETFrench

EESignature

Message 5 of 23

BlondieSL
Contributor
Contributor

Add me to that list.

But using the CSV file thing to search in Excel is fine if you're looking for a specific param in a huge list.

But what I'd like to see is a new feature where you could, for example, have a compare done that goes through the parameter list and finds hits in the actual build.

And/or DOESN'T find hits.

To be able to see a side-by-side comparison, even if exported to CSV file, would be valuable.

Right now, I'm seeing things listed in my main parameter list that seem to be from a different project.

Now I have to painstakingly go through it all, one..... by..... sigh.... ONE!     😕  😁

Message 6 of 23

etfrench
Mentor
Mentor

Open the csv file in Excel, then sort the parameters.

ETFrench

EESignature

0 Likes
Message 7 of 23

GRSnyder
Collaborator
Collaborator

Peripheral but perhaps of note: Fusion 360 will warn you before deleting a parameter that is used somewhere. So if the real question is not "where" but "whether", just try deleting the parameter.

Message 8 of 23

picadilly
Advocate
Advocate

I am missing a feature like that, too.

0 Likes
Message 9 of 23

davidpbest
Advocate
Advocate

My challenge is figuring out which features or dimension in a sketch use a given User Parameter.  I see the user parameter in the list (or CSV file), but I have no idea where it's used in the creation of the model.  A "Where Used" cross-reference list would be really helpful.  Maybe there's a way to see this but if so, it isn't obvious how to figure it out other than changing the parameter value and seeing what happens.  You can't zero it out to see where the error first occurs in the timeline - when trying that, Fusion just refuses to let the zero value pass through and reverts to the original value.

 

0 Likes
Message 10 of 23

davebYYPCU
Consultant
Consultant

Seems strange to me, that User Parameters (which allows for comments and documentation)

used by the author of the file - has no idea where it was used.

 

Shared file - fair enough.

0 Likes
Message 11 of 23

davidpbest
Advocate
Advocate

Why is that strange?  I haven't worked on this model for 3 years.  Can you remember the purpose of every parameter in a model with 140 such items after 3 years not thinking about it?  I sure can't.

Message 12 of 23

BlondieSL
Contributor
Contributor

It's been years since the original post/comments and since then, I have created a habit now of adding a comment to every parameter so as to know where it should be in the future if need be.

It just makes things easier, for sure.

0 Likes
Message 13 of 23

davidpbest
Advocate
Advocate

I too comment extensively, but honestly, with 140 commented parameters, it's still difficult to know where one is used.  I'm glad you all have such great memory and make such lucid comments on your parameters.  Gold star to you sir.

0 Likes
Message 14 of 23

picadilly
Advocate
Advocate

It is even worse, if you click on a dimension in a sketch and it tells you, it depends on "d1234". Where to the hell, do I find "d1234" in a larger design?!

Message 15 of 23

MichaelT_123
Advisor
Advisor

Hi Mr DavidPBest,

 

Yes, this is a very practical dilemma. 

How do you find a given parameter's influence on the design?

In the analogy, ... how do you find what/which DNA genome sequence affects... a pimple on a nose?

Extremally challenging ...

However, let's be optimistic: the designs we are dealing with are still relatively simplistic, if not primitive.

 

The design/user parameter dependency is accessible in most parts in the F360. (I am not sure if all set.)

It must be pointed out here that it is not a simple list. It is a graph of interdependency between ALL parameters, constituting in an effect a harmonious symbiotic design cluster (in many instances). 

The F360 API offers access to such graphs/interdependencies via:

  1. createdBy        Returns the object that created this parameter. For example, a feature, a sketch dimension, or a construction plane.
  2. dependencyParameters  - Returns a list of parameters that this parameter is dependent on.
  3. dependentParameters  - Returns a list of parameters that are dependent on this parameter as a result of this parameter being referenced in their equation.
  4. userParameters  - Returns the Collection containing the UserParameter.
  5. expression  - Gets and sets the expression (i.e. "22.064 mm") used to calculate the value of the parameter
  6. and perhaps some more …

…thus allowing such graph/interdependency reconstruction ( I am not sure if with 100% accuracy). However, the method is in the current F360 state and is not readily available for the … general designers.

Nevertheless, there is the good-bad news.

One can study the tables of UserParameters and ModelParameters accessible via UI, and paying particular attention to the Expression column.

The method requires persistence, patience and an Eagle Eye, hence the typical attributes of a good designer!

 

Regards

MichaelT

MichaelT
0 Likes
Message 16 of 23

davidpbest
Advocate
Advocate

I still maintain that a simple facility that generates a where-used cross reference and concordance would be a helpful addition. There is no way that I or anyone on my team is going to start screwing around with an API.  I totally concur with @picadilly comments that expressing a parameter dependency to some internally generated nomenclature such as “D1234“ is potentially helpful if you like frustratingly difficult treasure hunts, but all this could be made far more user-friendly and helpful to the designer who is picking up a model developed in years past or by someone else - someone who may or may not have had the instinct to leave extensive clues in the parameter comments field.  

0 Likes
Message 17 of 23

davebYYPCU
Consultant
Consultant

I was speaking to User Parameters - usually created before sketches.

I don't normally need to dig in to Model Parameters, and 3 years or not, I would not need 140 User Parameters in anything I do.

 

However the Author of the file, would not forget everything.

0 Likes
Message 18 of 23

davidpbest
Advocate
Advocate

Thanks for your helpful reply.

Message 19 of 23

kandennti
Mentor
Mentor

Hi @davidpbest -San.

 

We have created a simple sample script.
It outputs to a text command window what all user parameters are used for.

# Fusion360API Python script

import traceback
import adsk.core as core
import adsk.fusion as fusion

def run(context):
    ui: core.UserInterface = None
    try:
        app: core.Application = core.Application.get()
        ui = app.userInterface
        des: fusion.Design = app.activeProduct

        prmInfos = []
        for userPrm in des.userParameters:
            prmInfos.append(f"*** {userPrm.name} ***")
            dependentParameters = list(userPrm.dependentParameters)

            if len(dependentParameters) > 0:
                for prm in dependentParameters:
                    if prm.classType() == fusion.ModelParameter.classType():
                        prmInfos.append(f" (Model){prm.component.name}_{prm.createdBy.name}")
                    else:
                        prmInfos.append(f" (User){prm.name}")
                prmInfos.append("")
            else:
                prmInfos.append(" <Unused>\n")
                prmInfos.append("")

        app.log(app.executeTextCommand(u'window.Clear'))
        app.log("\n".join(prmInfos))

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

1.png
Note that configuration is not taken into account.

Message 20 of 23

davidpbest
Advocate
Advocate

Here is what I'd like to see in this regard.  See attached.  Right click on a User Parameter in the Parameters List, and you get a pop-up with some statistics about how many places the parameter is used, etc., but more importantly some indication (highlighting or arrows/boxes) as to where the User Parameter is used in the timeline and in the browser.  See attached.Where Used Example UI - 1.jpeg