EcadDocument.findAttributes Method

Parent Object: EcadDocument

PreviewThis functionality is provided as a preview of intended future API capabilities. You are encouraged to use it and report any problems or suggestions using the Fusion API and Scripts forum.

Because this is a preview of future functionality, there is the possibility that it will change, which will possibly break any existing programs that use this functionality. Because of that, you should never deliver any programs that use any preview capabilities. For a distributed program, you should wait until it has moved from preview to released state.


Defined in namespace "adsk::electron" and the header file is <Electron/EcadDocument/EcadDocument.h>

Description

Find attributes attached to objects in this product that match the group and or attribute name. This does not find attributes attached directly to the Product or Document objects but finds the attributes attached to entities within the product.

The search string for both the groupName and attributeName arguments can be either an absolute name value, or a regular expression. With an absolute name, the search string must match the entire groupName or attributeName, including case. An empty string will match everything. For example if you have an attribute group named "MyStuff" that contains the attribute "Length1", using the search string "MyStuff" as the group name and "Length1" as the attribute name will find the attributes with those names. Searching for "MyStuff" as the group name and "" as the attribute name will find all attributes that have "MyStuff" as the group name.

Regular expressions provide a more flexible way of searching. To use a regular expression, prefix the input string for the groupName or attributeName arguments with "re:". The regular expression much match the entire group or attribute name. For example, if you have a group that contains attributes named "Length1", "Length2", "Width1", and "Width2" and want to find any of the length attributes you can use a regular expression using the string "re:Length.*". For more information on attributes see the Attributes topic in the user manual.

Syntax

"ecadDocument_var" is a variable referencing an EcadDocument object.
returnValue = ecadDocument_var.findAttributes(groupName, attributeName)
"ecadDocument_var" is a variable referencing an EcadDocument object.

#include <Electron/EcadDocument/EcadDocument.h>

returnValue = ecadDocument_var->findAttributes(groupName, attributeName);

Return Value

Type Description
Attribute[] An array of Attribute objects that were found. An empty array is returned if no attributes were found.

Parameters

Name Type Description
groupName string The search string for the group name. See above for more details.
attributeName string The search string for the attribute name. See above for more details.

Version

Introduced in version May 2026