In MS2023 a new option was added in the Item Types, "Is default value". This allows the user to change the value of a Calculated Property. This does not update as the element the Item Type is attached to moves.
For example, If I add a property called Northing
this.GetElement().Origin.Y
and one called Easting
this.GetElement().Origin.X
then create a property called DefaultEditingTest (with the "is default value" set to true) that subtracts the Northing and easting properties.
this["Easting"] - this["Northing"]
When I move the element, the northing and easting update, but the DefaultEditingTest value does not update.
If I manually change the "DefaultEditingTest" value to zero, it updates:
A few questions here:
Does the following expression work.
this.GetElement().Origin.X - this.GetElement().Origin.Y
Use GetItem() check help
this.GetItem("DgnCustomItemTypes_Untitled:NE")["Easting"] - this.GetItem("DgnCustomItemTypes_Untitled:NE")["Northing"]
instead of
Can you share a sample DGN for us to test.
This does not work. I tested this.GetElement().Origin.X - this.GetElement().Origin.Y as suggested.
(I had originally tested the Easting with the "Is default set" value to true and it did not update)
I also tested the GetItem, but that did not work:
this.GetItem("DgnCustomItemTypes_DelDOT_ORD_Schedules:Testing")["Northing"] - this.GetItem("DgnCustomItemTypes_DelDOT_ORD_Schedules:Testing")["Easting"]
I have attached my DGN as an example.
DELETE5 - Copy.dgn
Can you try using the Subtract operator from the Expression toolbar.
Dash "-" and Subtract Operator "-" are different.
DELETE5 - Copy1.dgn
I tried that and it did not work. I even went as far as clearing and not typing anything in manually:
Same result.
What is the "Dash" operator and how does it differ from the "Subtract" operator? I have been using "Dash" for a while and as far as I can tell it functions exactly the same as "Subtract".
Is this working for you? Are you able to send me a file using your vanilla standards with it working so I can compare to mine?
Hello,
The 'Is Default Value' was added to enable users to use get the calculated value for the first time. Once placed or during placement this field is editable and can be changed. The Item Type using the 'Is Default Value ' will not be calculated using the expression after placement .
please check help under Home > Drawing Composition > Annotations > Item Types > Item Types Dialog
If you want the Item to be updated, then use the 'Is Default Value' = No
Thanks
Nilesh Sawant
Answer Verified By: dkleinot
Thanks you for the detailed response! I will put in a Aha! for this to be changed.
#4 isn't accurate tho. If I set a Number or Integer type to Zero, it will revert to the calculated value.