Create Symbolic line for shafts

Create Symbolic line for shafts

shehab_fekry
Enthusiast Enthusiast
548 Views
1 Reply
Message 1 of 2

Create Symbolic line for shafts

shehab_fekry
Enthusiast
Enthusiast

I Want to create symbolic line for shafts to make the " X " sign inside shafts, to do that manually You have to open Edit sketch mode and change the used lines from Boundary line to Symbolic line. I'm trying to do that using Revit API and trying to Edit Sketch mode but I can't make symbolic lines. I managed to create Boundary lines but how to make it Symbolic 

 

  SketchEditScope sketchEditScope = new SketchEditScope(doc, "Edit Sketch");
                var opSketch = opening.SketchId.GetElement(doc) as Sketch;
                var opBoundingBox = opening.get_BoundingBox(null);
                var sketchZ = opBoundingBox.Max.Z;
                var max = opBoundingBox.Max;
                var min = opBoundingBox.Min;
                sketchEditScope.Start(opSketch.Id);
                using (Transaction te = new Transaction(doc,"Sketch"))
                {
                    te.Start();
                    var line = Line.CreateBound(new XYZ(min.X, min.Y, sketchZ), new XYZ(max.X, max.Y, sketchZ));
                    var mdCurve = doc.Create.NewModelCurve(line, opSketch.SketchPlane);
                    te.Commit();
                }
                sketchEditScope.Commit(new FailureHandler());

 

Can that be done using Edit Sketch mode or is there any other way?

0 Likes
549 Views
1 Reply
Reply (1)
Message 2 of 2

RPTHOMAS108
Mentor
Mentor

Unfortunately I don't think this is a feature of the sketch edit scope as it mainly focusses on the boundary outline.

 

You encounter similar issues adding models lines representing floor span and slope direction to floors (if such things already exist without them).

 

The ModelCurves are all of the sketch category but the GeometryStyle within the geometry curve is specific to a line style. However that can't be set within the edit scope so the edit scope treats it as a boundary and posts a failure upon completion.

 

There needs to be methods for adding curves of:

Symbolic Lines (Shafts)

Span Direction Lines (Floors)

Slope Arrow Lines (Floors/Roofs/Ceilings)

 

I can't think of any others, the stairs have their own editing scope.

 

Best to be method within the SketchEditScope for adding these i.e. :

SketchEditScope.AddCurve(SketchCurveType)

With SketchCurveType being a simple enum e.g.:

 

BoundaryCurves = 0

SymbolicCurves

SpanDirectionLine

SlopeArrowLine = 3

 

I could add this as an idea but I think it is pretty basic thing you often do in the UI that you seemingly can't do with the API. Most end users would not create a shaft opening without a symbolic representation of such contained within its sketch. I think perhaps it is just a lack of understanding of how Revit is used in that regard (or how often it is used in the UI).

 

You likely can still copy shafts in from elsewhere and adjust the lines in those but that isn't ideal.

0 Likes