Table of Contents

Class CalloutModel

Namespace
Hymma.Solidworks.Addins
Assembly
Hymma.Solidworks.Addins.dll

Allows add-in applications to manipulate single and multi-row callouts

public class CalloutModel : IWrapSolidworksObject<Callout>, IReleaseSolidworksObject
Inheritance
CalloutModel
Implements
Inherited Members

Constructors

CalloutModel(List<CalloutRow>, ISldWorks, ModelDoc2, bool)

create a callout

public CalloutModel(List<CalloutRow> rows, ISldWorks solidworks, ModelDoc2 model, bool updateWithSelection = true)

Parameters

rows List<CalloutRow>

list of string in this callout. will be add to the UI in the same order added to this list

solidworks ISldWorks

solidworks object

model ModelDoc2

model to add selection

updateWithSelection bool

will make callout dependent on selection if set to true.

CalloutModel(List<CalloutRow>, ISldWorks, ModelView)

Creates a callout independent of a selection in a SolidWorks.Interop.sldworks.ModelView

public CalloutModel(List<CalloutRow> rows, ISldWorks solidworks, ModelView modelView)

Parameters

rows List<CalloutRow>

list of string in this callout. will be add to the UI in the same order added to this list

solidworks ISldWorks

solidworks object

modelView ModelView

model view to create the callout in

Properties

FontSize

Gets or sets the font size for this callout.

public int FontSize { get; set; }

Property Value

int

Handler

solidworks event handler for a callout

public SolidworksCalloutHandler Handler { get; }

Property Value

SolidworksCalloutHandler

HasTextBox

Gets or sets whether the callout text is enclosed within a box

public bool HasTextBox { get; set; }

Property Value

bool

MultipleLeaders

Gets or sets the display of multiple leaders for this callout.

public bool MultipleLeaders { get; set; }

Property Value

bool

OpaqueColor

Gets or sets the opaque (background) color for the labels for this callout.

public SysColor OpaqueColor { get; set; }

Property Value

SysColor

Remarks

You must use a SysColor; you cannot use any other RGB values. To see system colors, click Tools > Options > Colors. in the SOLIDWORKS user interface

Position

Gets and sets the position of this callout.

public Tuple<double, double, double> Position { get; set; }

Property Value

Tuple<double, double, double>

SkipColon

Gets and sets whether to add a colon : at the end of the callout label.

public bool SkipColon { get; set; }

Property Value

bool

Solidworks

solidowrks object

public SldWorks Solidworks { get; }

Property Value

SldWorks

SolidworksObject

actual solidworks SolidWorks.Interop.sldworks.ICallout object assigned to by addin

public Callout SolidworksObject { get; }

Property Value

Callout

TargetStyle

Gets or sets the type of connection at the e point for this callout.

public swCalloutTargetStyle_e TargetStyle { get; set; }

Property Value

swCalloutTargetStyle_e

TextFormat

Gets or sets the text format for this callout.

public TextFormat TextFormat { get; set; }

Property Value

TextFormat

Methods

AddRow(CalloutRow)

adds a new row to this callout

public void AddRow(CalloutRow row)

Parameters

row CalloutRow

GetRowIds(string)

get the row id for the value provided

public List<int> GetRowIds(string value)

Parameters

value string

Returns

List<int>

GetRows()

each row in a callout has an id and a text value

public List<CalloutRow> GetRows()

Returns

List<CalloutRow>

list of rows in a callout

LeaderStatus(bool, bool)

Sets the leader properties of the callout.

public bool LeaderStatus(bool visible, bool multiple)

Parameters

visible bool

True to display the leader, false to not

multiple bool

True to display multiple leaders, false to not

Returns

bool

True if the operation is successful, false if not

Remarks

You can only use this method before the callout is shown or while the callout is hidden.
If Visible is set to false, then ICallout::TargetStyle is automatically set to swCalloutTargetStyle_None.

ReleaseSolidworksObject()

release solidworks object

public void ReleaseSolidworksObject()