Methode · LibraryFeatureData
AccessSelections-Methode (LibraryFeatureData)
Setzt das Modell vor das Bibliotheks-Feature zurück, damit du die Auswahlen lesen und ändern kannst, die es festlegen.
Syntax
Function AccessSelections( _
ByVal PTopDoc As ModelDoc2, _
ByVal PComponent As Component2 _
) As BooleanbErfolg = swDaten.AccessSelections(swModel, Nothing)Parameter
PTopDocModelDoc2ByVal- Das oberste Dokument (
ModelDoc2): das Teil, oder die Baugruppe, wenn du das Feature in einer Komponente änderst. PComponentComponent2ByVal- Im Teil
Nothing. In der Baugruppe die Komponente (Component2), in der du das Feature ändern willst.
Rückgabewert
True, wenn der Zugriff auf die Auswahlen geklappt hat, sonst False.
Beispiel
' swModel ist das Teil (ModelDoc2), swFeat ein Bibliotheks-Feature (Feature).
Dim swDaten As SldWorks.LibraryFeatureData
Set swDaten = swFeat.GetDefinition
If swDaten.AccessSelections(swModel, Nothing) Then
swDaten.LinkToLibraryPart = False
If False = swFeat.ModifyDefinition(swDaten, swModel, Nothing) Then swDaten.ReleaseSelectionAccess
End IfBemerkungen
Die Methode setzt das Modell in einen Rücksetz-Zustand (rollback), damit du an die Auswahlen kommst, die das Feature festlegen. Diesen Zustand musst du wieder aufheben: mit Feature.ModifyDefinition, wenn du das Feature geändert hast, sonst mit LibraryFeatureData.ReleaseSelectionAccess. Das Hilfebeispiel „Get Library Feature Data“ ruft AccessSelections vor dem Lesen auf, „Create Library Feature With References“ vor LibraryFeatureData.SetReferences.
Siehe auch
Verfügbarkeit
SOLIDWORKS 2006
Englisches Original: ILibraryFeatureData::AccessSelections in der SOLIDWORKS API-Hilfe ↗ (dort mit dem .NET-Namen)
Fragen zu diesem Befehl oder ein Befehl fehlt? Frag im Discord.