Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hello everyone. I have a question. Is it possible to get a list of dimensions with a certain color?
I need to get the dimension text color, like a note text color:
var ret = drawing.ListDetailItems(pfcCreate("pfcDetailType").DETAIL_NOTE,0).Item(i).GetNoteTextStyle().GetColor();
But I don't find it. Please help me.
I think there are 2 relevant points of the display color of an dimension.
1.) for default display - means the text style was not changed explicitly the displayed color depends from he setting of the drawing detail option (dtl option) drawing_text_color (letter_color (default value) or edge_highlight_color)
2.) in case that dimension text style is set explicitly then such request could make sense
When we check more detailed hwo we can change the dimen color - it is possible only as text (picture)
So the text style command is applied then of dimension objects.
So to find the drawing dimenions we can use some construct like:
var DwgDims = drawing.ListItems ( pfcCreate("pfcModelItemType").ITEM_DIMENSION); for (var i=0;i<DwgDims.Count;i++) { //All we do here is read the location from each dimension? //for (var j=0;j<10;j++) { var SelDim = DwgDims.Item(i); var TextLocPnt = SelDim.Location;//Gets point3D var dimView=SelDim.GetView(); //.... do some other things here } } ...
When we check the property of 2d dimensions object we can not find there a method to access the text style:
So means that it is not possible to access it via Web.Link or you can try to cast the dimension object to detail note item - what obviosly the User Interface do. I am not sure if such construct will work but you can just try it.
something like ( but no idea if this could work) :
var detItem =( pfcDetailNoteItem) DwgDims.Item(i);
var color= detItem.GetNoteTextStyle().GetColor();