DimensionGuids.Clear(); SelectedDimensionsFromRhino.Clear();; var selectedDimensions =…
- User
DimensionGuids.Clear(); SelectedDimensionsFromRhino.Clear();; var selectedDimensions = SelectDimensions(out ListdimObjectsGuids); DimensionGuids.AddRange(dimObjectsGuids); SelectedDimensionsFromRhino.AddRange(selectedDimensions); for (int i = 0; i < SelectedDimensionsFromRhino.Count; i++) { var dim = SelectedDimensionsFromRhino[i]; //dim.RichText = "Ali" dim.ParentDimensionStyle = RhinoDoc.ActiveDoc.DimStyles.FindName(StyleName); dim.LengthFactor = LenghFactor; var obj = Rhino.RhinoDoc.ActiveDoc.Objects.FindId(new Guid(DimensionGuids[i])); Guid objId = new Guid($"{obj.Id}"); Rhino.DocObjects.ObjRef objRef = new Rhino.DocObjects.ObjRef(objId); var rhinoObj = objRef.Object(); var annotation = rhinoObj as Rhino.DocObjects.AnnotationObjectBase; Rhino.RhinoDoc.ActiveDoc.Objects.Replace(objRef, dim, true); Rhino.RhinoDoc.ActiveDoc.Views.Redraw(); }
is it possible to change the layer while replacing?
- Assistant
Yes, it is possible to change the layer of an object when replacing it in Rhino. You can modify your loop to set the desired layer for each dimension before replacing the object. Here’s how you can do it:
- Retrieve the target layer by its name or index.
- Assign the layer index to the geometry attributes of the dimension.
- Replace the object with the new geometry and updated attributes.
- User
Severity Code Description Project File Line Suppression State Error (active) CS1501 No overload for method 'Replace' takes 4 arguments EmreIstikam001 C:\WorkShare\EmreIstikam00.1\component\TehranOffice\Components\3D DEN 2D YE\Olculendir(Manual)\OlculendirManualGH.cs 172
- Assistant
- User
Severity Code Description Project File Line Suppression State Error (active) CS1503 Argument 3: cannot convert from 'Rhino.DocObjects.ObjectAttributes' to 'bool' EmreIstikam001 C:\WorkShare\EmreIstikam00.1\component\TehranOffice\Components\3D DEN 2D YE\Olculendir(Manual)\OlculendirManualGH.cs 173
- Assistant