SolidWorksMakroprogrammierung

Enumeration · SwConst

swBOMConfigurationAnchorType_e-Enumeration

An welcher Ecke eine Tabelle in der Zeichnung verankert ist, etwa Stückliste, Bohrungstabelle oder Revisionstabelle: oben oder unten, links oder rechts.

Bibliothek SwConst · 4 Werte · im Code direkt mit Namen verwendbar, zum Beispiel swBOMConfigurationAnchor_TopLeft

Syntax

Enum swBOMConfigurationAnchorType_e
    swBOMConfigurationAnchor_TopLeft     = 1
    swBOMConfigurationAnchor_TopRight    = 2
    swBOMConfigurationAnchor_BottomLeft  = 3
    swBOMConfigurationAnchor_BottomRight = 4
End Enum

Werte

KonstanteWertBedeutung
swBOMConfigurationAnchor_TopLeft1Ecke oben links.
swBOMConfigurationAnchor_TopRight2Ecke oben rechts.
swBOMConfigurationAnchor_BottomLeft3Ecke unten links.
swBOMConfigurationAnchor_BottomRight4Ecke unten rechts.

Beispiel

' swView ist eine Zeichenansicht (View), etwa aus SelectionMgr.GetSelectedObject6.
Dim swBomTable As SldWorks.BomTableAnnotation
Dim sVorlage As String
sVorlage = "C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\lang\german\bom-standard.sldbomtbt"
Set swBomTable = swView.InsertBomTable6(True, 0, 0, swBOMConfigurationAnchor_TopLeft, _
    swBomType_PartsOnly, "", sVorlage, False, swNumberingType_None, False, False, False)
If swBomTable Is Nothing Then Debug.Print "Stückliste nicht eingefügt."

Bemerkungen

Trotz des Namens gilt die Enumeration nicht nur für Stücklisten: Die Hilfe nutzt sie auch für allgemeine Tabellen, Revisions-, Bohrungs-, Biege-, Stanz- und Schweißtabellen. Bei einer vorhandenen Tabelle liest oder setzt du die Ecke mit TableAnnotation.AnchorType.

Beim Einfügen wirkt der Wert zusammen mit UseAnchorPoint: Ist er True und hat das Blattformat einen passenden Ankerpunkt, setzt SOLIDWORKS die Tabelle dorthin, sonst an die Koordinaten X und Y. Bei allgemeinen Tabellen (DrawingDoc.InsertTableAnnotation2, ModelDocExtension.InsertGeneralTableAnnotation) wird der Ankertyp ignoriert, wenn du eine Tabellenvorlage angibst.

Verwendet von

Englisches Original: swBOMConfigurationAnchorType_e in der SOLIDWORKS API-Hilfe ↗

Fragen zu diesem Befehl oder ein Befehl fehlt? Frag im Discord.