Hello,
I am looking to create an Expression to retrieve the Variation value of a profile which is part of a paramteric solid.
It looks like this:
The for me most obvious expression would be this.GetElement().GetDisplayValue("Variation"), but that does not give any result.
Is it possible to retrieve this info and if yes, how to do that?
Thanks,Andre
Hi Andre,
Apologies for delayed reply.I have gone through your test file and observed that, you have used expression *this.GetElement().GetDisplayString("Variation")*.Here, Variation is display name of property and it's internal name is *ParameterSetName*.So, you need to use expression as *this.GetElement().GetDisplayString("ParameterSetName")*.This will return you correct value at Profile item type as below: Now, if you want to fetch this *Variation* at *Parameter Solid* level then, you need to use expression as below:
this.GetItem("SmartFeaturesSchema:SmartFeatureContainer").GetRelatedItem("SmartFeatureToCellParametersRelationship:1:ParametricCellElement").ParameterSetName
This expression is working at report dialog but unfortunately, not working at element properties dialog. I will try to check this at my side. Hope this will help you.
Please find attached file where I have added expression.
3463.TestExpression.dgn
Hi Sanjivani,
thanks a lot for your effort and explanation!
Honestly, I am mad at myself, I was pretty close, but I did one mistake when I tried GetRelatedItem() method (even when the use schema was right), so my conclusion was this approach does not work (and I did not test it with reports).
There is always an opportunity to learn something new :-)
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi All,
In addition to GetRelatedItem, there is method GetRelatedInstance.
Please try to use GetRelatedInstance instead of GetRelatedItem as both functions are same.
We are going to deprecate GetRelatedItem as it makes confusion at native and managed implementation.
Regards,
Sanjivani
Sanjivani Ichake said:We are going to deprecate GetRelatedItem as it makes confusion at native and managed implementation.
Great., good to know, thanks! :-)
Thank you very much for your answer.Unfortunately I am busy with other things at the moment and will be the next week as well. I will take a closer look at your answer in 1.5 weeks time.Excuses for the delay.Regards,Andre