Hi Tuanh,
in the ALLPLAN Python API , there is no differentiation between ALLPLAN native attributes and user-defined attributes. If you for some reason need only the user-defined attribute IDs, you can simply read them from the .xml:
from pathlib import Path
import xml.etree.ElementTree as ET
def get_user_defined_attributes() -> list[int]:
prj_path = Path(AllplanSettings.AllplanPaths.GetCurPrjPath())
attribute_definitions = prj_path / Path("Xml\AttributeDefinitionCollectionLocal.xml")
tree = ET.parse(attribute_definitions)
root = tree.getroot()
return [int(attribute.find('Ifnr').text) for attribute in root.findall('AttributeDefinition')]
This function will return you the IDs of all user-defined attributes defined in a project. But note, that attributes can also be defined for the whole office (in std/xml/AttributeDefinitionCollectionLocal.xml). It depends on a project, whether it has its own definitions or not.
When you have the ID of an Attribute, you can use the AttributeService to get its name, value type, default values or any other kind of data.
Maybe you can explain more, why you need this differentiation?
I hope that helps!
Best,
Bart