Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I am using Revit 2015 and VS 2013.
I want to change few properties of the existing dimension like "Witness Line Control" from -> Fixed to Dimension Line to "Gap to Element".
This is what I have done so far, but didn't really gave me the results intended. I am able to change the position of Dimension but not edit this property.
using(Transaction trans = new Transaction(doc, "ModifyDim")) { trans.Start(); foreach (Dimension dim in coll) { int count = dim.Segments.Size; if(count > 0) { for (int i = 0; i < count; i++) { if (dim.Segments.get_Item(i).ValueString == "5880") {
// trying to change the witness line control property ElementType dimType = doc.GetElement(dim.GetTypeId()) as ElementType; Parameter attribute = dimType.get_Parameter(BuiltInParameter.DIM_WITNS_LINE_CNTRL); bool value = attribute.HasValue; attribute.SetValueString("Gap to Element"); attribute.Set("Gap to Element");
// Moving dim to new position XYZ point = new XYZ(0, 50, 0); dim.Location.Move(point); } } } else { if(dim.ValueString == "1740") { XYZ point = new XYZ(80, 0, 0); dim.Location.Move(point); } } } trans.Commit(); }
Looking forward to any help or tips on how can I achieve this.
Thanks
Suraj
Solved! Go to Solution.