Early this month, I published a script to sort elements from a selected package by the alias name. This article provides another project browser script that finds and selects the classifier for an instance or a class attribute, or the property type for a SysML port or part.
Sparx Enterprise Architect makes it possible to find from a diagram an instance classifier with a right click > Find > Locate Classifier in Project Browser, or a SysML port/part's classifier with a right click > Find > Locate Property Type in Project Browser.
As there isn't any similar feature from the project browser, I wrote a script to achieve it, whilst extending it to a class attribute.
Enterprise Architect Project Browser scripts
Enterprise Architect lets you create project browser scripts. Once created in your project, these are available via a right click on a selected package from the browser, as illustrated below:
Find the classifier of an instance, port, part, or attribute with FindClassifier project browser script
To add the FindClassifier Project Browser script to your modelling project:
Step 1: open the scripting view using the Enterprise Architect menu Tools > Scripting.
Step 2: click on "New Project Browser Group" to store all user-defined scripts, e.g. Project Browser scripts.
Step 3: click on "New script > New VBScript" to define the "Find Classifier" script, e.g. FindClassifier.
Step 4: open the script and copy/paste the content from the following file: download FindClassifier VBScript text file.
Step 5: save the script (Ctrl-S).
Step 6: test the FindClassifier script with a right click on a selected object from the Project Browser to find its classifier, and select Scripts > FindClassifier
Result: the instance's class has been selected from the Project Browser as illustrated below.
Here is another example of using this script with a class attribute: