Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Anotation Style Creation in Version 7

$
0
0

I am trying to create an annotation style. From looking at the examples I came up with this:

        //Create the style and return the index. Don't save with the file.
        int dsi = doc.DimStyles.Add("ToolingList",false);
        DimensionStyle ds = doc.DimStyles[dsi];
        ds.Font = new Font("Arial Black", FontWeight.Bold, Font.FontStyle.Upright, false, false);
        ds.DimensionScale = 5.0;
        ds.LengthResolution = (int)1.1;
        ds.AngleResolution = (int)1.1;
        ds.TextHeight = 5;
        ds.TextGap = .25;
        ds.ExtensionLineExtension = 3.5;
        ds.ExtensionLineOffset = 1.9;
        ds.LeaderArrowLength = 3.1;
        ds.ArrowLength = 2.2;
        ds.TextHorizontalAlignment = TextHorizontalAlignment.Auto;
        **ds.CommitChanges();**   

There is no method “CommitChanges” in the DimensionStyle class and changes are not stored without some action i think. If I run the code without the CommitChanges it will create the style but does not change any of the attributes.

Should there be something here to commit the changes to the new style?

Is there a class that allows you to create the style in code then assign it to doc.DimStyles? This looks like it is setup to be a fail save when you have to create the style then change attributes from the default.

Please let me know if I am looking in the wrong spot in the documentation for the API.

Best;

Steve

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles