Harness proD API Help
EPLAN.Harness.API.Occurrences.Nailboard Namespace / OccNbPin Class / NoteFont Property
Example
In This Topic
    NoteFont Property
    In This Topic
    Specifies font of note.
    Syntax
    public ApiFont NoteFont {get; set;}
    Example
    // Init API
    HpdApi api = HpdApi.GetInstance();
    
    // Open project and variant and document
    Project project = api.OpenProject(@"d:\Project.hxproj");
    				
    Variant variant = project.GetVariants()[0];
    Drawing2D nailboard = variant.GetNailboards().FirstOrDefault(w => w.Name == "Nailboard_1");
    nailboard.Open(false, false);
    
    // Obtain the pin occurrence.
    OccNbPin pin = nailboard.GetAllOccurrences().OfType<OccNbPin>().FirstOrDefault(o => o.Name == "X1:1");
    if (pin == null)
    {
    	// Resolve this issue.
    }
    
    // Enable properties of note for editing.
    pin.Defaults = false;
    pin.PinNote = true;
    
    // Set up font properties
    pin.NoteFont.FamilyName = "Tahoma";
    pin.NoteFont.Size = 20f;
    pin.NoteFont.Bold = true;
    pin.NoteFont.Italic = true;
    pin.NoteFont.Underlined = true;
    
    // Save changes and close documents.
    nailboard.Save();
    
    nailboard.Close();
    project.Close();
    See Also