Recently a question was asked on the AutoCAD MEP forums about how to put the elevation of a Mass Element in a property set definition when neither the location or the elevation was available as an automatic property. You can view the original post here. Since this was very similar to a post that was covered previously on this blog it was an easy solution. First I created a new property set definition that referenced a mass element and then added the automatic property definition OBJECTID. Once that was complete I created a new formula definition and added the following code. Make sure to replace the [OBJECTID] in the code below with a reference to the automatic property!
I get a lot of questions on schedules and property sets and instead of reinventing the wheel I thought I would point out a set of 4 videos by Jay Ayala of Autodesk. Enjoy.
Property Set Definitions
In the last post we looked at how to add an undocumented property to a property set definition. This time lets try to add a formula based location property to a space object using the method from the last post.
When this property definition is created and made visible there is no information being reported. The property definition is blank. Why is this? This is because a location property is actually made up of three different values (x,y, and z) that are stored as a point object in the system. VBScript does not know how to read point objects so the point object will first need to be converted into an array before it can read. The following code gets the space location and breaks the location point up into its 3 separate values and then concatenates them together as a string so we can read them and returns the result.
The value of the property definition should look something like this 144.124;1200.375;0. This would place the space object 12′-0 1/8″ on the positive X axis, 100′- 0 3/8″ on the Y axis and at a zero elevation. If you would like to see more or less decimal places in the result then you can change the second line of code from DecimalPlaces = 3 to DecimalPlaces = X where X is the amount of decimal places you would like to see. And finally if you are only interested in the elevation of the space then you can modify the result of the script to instead say RESULT = LocationZ. There is no need to convert to a string in this case as a number would be more preferable as the units of the property definition could then be set to a length value and read as feet and inches.
If you heavily use property sets then at one time or another you have found the need to schedule a property that is not readily available via an automatic property definition. For example when creating a pipe system you can assign it a system family (commonly known as group) that will allow different systems of the same family to interconnect. Systems that are not of the same group will not interconnect. This could be a handy property to schedule but how do you do it? System group is not an automatic property of MEP objects.
First start the style manager and then open up the property set that you wish to add the system family definition to. The first thing that needs to be done is to add the automatic property definition ObjectID to the property set. This is needed to access information about the object. Then just add the following code to a formula based property definition:
Make sure to input [ObjectID] by clicking on the definition in the Insert Property Definition section in the lower left portion of the dialog window. Hit Ok and make sure to make your new property definition viewable so you can see it on the property palette’s extended tab.