How to get all available properties, standard and custom through API

How to get all available properties, standard and custom through API

matt.worland
Advisor Advisor
4,372 Views
7 Replies
Message 1 of 8

How to get all available properties, standard and custom through API

matt.worland
Advisor
Advisor

Im looking to find a way to see all of the available properties (piping, equipment, steel...) and their values in a drawing. Similar to going into the database and looking at all the properties from the EngineeringItems table.

I can see the properties of an item from the dlm, but that means going through every item in the drawing and keeping a distinct list of properties. Is there a way to search the Project or PlantProject classes and get a list of all properties using the API?

If my reply was helpful, please give a "Thumbs Up" or "Accept as Solution"
0 Likes
Accepted solutions (3)
4,373 Views
7 Replies
Replies (7)
Message 2 of 8

jabowabo
Mentor
Mentor

What do you want the results to look like? Or how should they be stored? Do you not want the drawing opened at all to retrieve the data?

 

If I remember correctly, Plant structural info doesn't reside in the database. It's probably in the Xdata.

Message 3 of 8

matt.worland
Advisor
Advisor

I'm not too picky on data storage type. Basically looking for a list of all possible properties from all items in a project, or drawingin a project.

 

I just figured there may be a method that reads into the project data to extract all properties instead of looking at every item in the drawing and creating a list that way.

 

For now just looking at the current drawing, but would be nice to look through all drawings.

If my reply was helpful, please give a "Thumbs Up" or "Accept as Solution"
0 Likes
Message 4 of 8

hyrro_velasquez
Advocate
Advocate
Accepted solution

Hi, Sir @matt.worland 

 

I try this code Sir, and it works, unfortunately it is for piping properties only, but may be you can try to modify the code for other group category.

https://adndevblog.typepad.com/autocad/2012/05/getting-all-the-properties-of-a-selected-pipe-in-plan...

 

hyrro_velasquez_0-1616493464972.png

 

 

0 Likes
Message 5 of 8

jabowabo
Mentor
Mentor
Accepted solution
DataLinksManager.GetAllProperties(partRowId, true)

GetAllProperties returns a list (List<KeyValuePair<string, string>>) of properties for piping, equipment, and structural. If you want properties for a specific drawing, you have some options:

1. Iterate the drawing objects, find the RowId from each ObjectId, get the properties. Note: the drawing must be open in project context to get RowIds from ObjectIds.

2. Iterate the relevant database tables, iterate each row, use the Row.RowId to get the properties. If you need to know which drawing each item is in, you need to query the PnPDataLinks table and PnPDrawings table.

0 Likes
Message 6 of 8

matt.worland
Advisor
Advisor
Accepted solution

Thanks, I was hoping to not have to hit every entity.

 

I did find I could iterate the GetAllClassDisplayNames, along with iterating GetAllColumnDisplayNames. This will give me a complete list of Column Display Names (property names). Now to see if there is a way to convert a ColumnDisplayName to the matching property name in dlm.GetAllProperties when I'm searching for a match on a single entity.

If my reply was helpful, please give a "Thumbs Up" or "Accept as Solution"
Message 7 of 8

kgallagherCGHDN
Advocate
Advocate

ok so i can get/set properties, but it looks like the dimensions are held in theParamiter list any thoughts on how to set them? I can list them all but cant set it.

 

Dim Param As New ParametricPart(Partx)
Dim Parinfo As ACPUtils.ParameterList = Param.Parameters
Dim Info1 As ACPUtils.ParameterInfo = Parinfo.Item("L1")

Info1.Value = NewLen

0 Likes
Message 8 of 8

matt.worland
Advisor
Advisor

I'm not sure if you found another way to set the new values, but it looks like going this route, they are GET only

mattworland_0-1745321732875.png

 

If my reply was helpful, please give a "Thumbs Up" or "Accept as Solution"
0 Likes