Three problems I’m having today I’m hoping to get some help with:
I’m trying to change the annotation text style using the sample located here: http://wiki.mcneel.com/developer/rhinocommonsamples/dimstyle
But it seems I need some import statements (I often wonder why these aren’t included…). In particular, AnnotationObjectBase gives me an error. I would try to figure it out on my own with the rhinocommon documentation, but it seems to be down (403 - Forbidden: Access is denied). The offline documentation seems to be having trouble too.
I’ve changed the linetype for a layer, but it does not change to that type until I click on the linetype in rhino. Here is the code I’m using for that:
Dim LayerLinesIndex = doc.Layers.Add(“Lines”, Drawing.Color.White)
Dim LayerLines = doc.Layers(LayerLinesIndex)
LayerLines.LinetypeIndex = 5
I would like to set the viewport display modes to shaded. I think the following sample might be what I’m looking for: http://wiki.mcneel.com/developer/rhinocommonsamples/advanceddisplay
But similar to the annotation style sample, I get an error, this time for DisplayModeDescription I think because there are some import statements missing that I need… Am I even on the right track, perhaps there is a quick simple way to change to shaded mode?
protected override Rhino.Commands.Result RunCommand(Rhino.RhinoDoc doc, Rhino.Commands.RunMode mode)
foreach (var rhino_object in doc.Objects.GetObjectList(Rhino.DocObjects.ObjectType.Annotation))
var annotation_object = rhino_object as Rhino.DocObjects.AnnotationObjectBase;
if (annotation_object == null) continue;
var annotation = annotation_object.Geometry as Rhino.Geometry.AnnotationBase;
if (annotation == null) continue;
if (annotation.Index == doc.DimStyles.CurrentDimensionStyleIndex) continue;
annotation.Index = doc.DimStyles.CurrentDimensionStyleIndex;
The standard documents included with Rhino do not contain any other linetype than continuous. So before assigning a linetype index to a layer, you might want to make sure the linetype exists in the document (RhinoDoc.Linetypes). Note, clicking a linetype control in Rhino adds the linetype(s) for you, which is why it works after you click…
Actually, this sample shows you how to modify an existing display mode, which isn’t what you say you are looking for. How about this sample?
In regards to your answer for question 2, I think you’re talking about something a bit over my head; I’m not sure how the standard document doesn’t have additional linetypes, but the document that opens when rhino opens does have multiple line types.
Basically, I want to be able to create curves with line type anything other than continuous. How can I do this?