Hallo Zusammen,
ich bin gerade dabei die Zeichnungserstellung zu automatisieren. Ich möchte nun eine Bruchkantenansicht erstellen.
Ich habe nun folgendes Problem:
Ich möchte die Position der Bruchkanten verschieben, bekomme aber immer den Returnvalue false. Selbst wenn ich die Bruchkanten an die gleiche Stelle wie mit GetPosition setze.
Hier meine Makrozeilen.
Option Explicit
Dim swApp As Object
Dim Part As Object
Dim swView As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Dim BreakLine As Object
Dim SelMgr As SelectionMgr
Dim vPos As Variant
Dim xPos1 As Double
Dim xPos2 As Double
Dim retval
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID("Zeichenansicht1", "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing)
Part.InsertBreakVertical
boolstatus = Part.Extension.SelectByID("Zeichenansicht1", "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing)
Set SelMgr = Part.SelectionManager
Set swView = SelMgr.GetSelectedObject5(1)
vPos = swView.position
boolstatus = Part.Extension.SelectByID("Bruchlinie1", "BREAKLINE", 0, 0, 0, False, 0, Nothing)
Set SelMgr = Part.SelectionManager
Set BreakLine = SelMgr.GetSelectedObject5(1)
xPos1 = BreakLine.GetPosition(0)
xPos2 = BreakLine.GetPosition(1)
retval = BreakLine.SetPosition(xPos1, xPos2)
Gruß Bernd
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP