Hallo
Ich erstelle ein Makro, um eine "Animation" zu erstellen, die es mir ermöglicht, eine Abfolge von Modifikationen und Konfigurationsänderungen zu sehen. Ich hänge einen Teil des Codes an. Mein Problem ist, dass das Bild nicht aktualisiert (angezeigt) wird. Der Code wird berücksichtigt, aber auf dem Bildschirm gibt es nur den ersten und den letzten Schritt, die trotz des "boolstatus = Part.ForceRebuild3(True)" sichtbar sind.
Haben Sie eine Idee?
Dimmen swApp als Objekt
Teil als Objekt dimmen
Dim boolstatus als boolescher Wert
Dim longstatus As Long, longwarnings As Long
public declare ptrSafe sub sleep lib "kernel32" (ByVal dwMilliseconds as LongPtr) 'Für 64-Bit-Systeme
Sub main()
Diim i Als Single
swApp = _ setzen
Anwendung.SldWorks
Set Part = swApp.ActiveDoc
myModelView als Objekt dimmen
Festlegen von myModelView = Part.ActiveView
'Konfigurationsauswahl
boolstatus = Part.Extension.SelectByID2("Klein [55-145mm]", "KONFIGURATIONEN", 0, 0, 0, Falsch, 0, Nichts, 0)
boolstatus = Part.ShowConfiguration2("Klein [55-145 mm]")
'boolstatus = Teil.ForceRebuild3(Wahr)
Warte
Für i = 0,055 bis 0,145 Schritt 0,005
boolstatus = Part.Extension.SelectByID2("", "GESICHT", 1.88162450943423E-02, 2.07610918535579E-02, 3.41903065946383E-02, Falsch, 0, Nichts, 0)
Part.ActivateSelectedFeature
boolstatus = Part.Extension.SelectByID2("L inter épau@Sketch1@Flex_flexible-1@EX10610_00000_10_boni", "DIMENSION", 0.516914003349862, 0.726763465357772, 0.299002280968981, False, 0, Nichts, 0)
MyDimension als Objekt dimmen
Set myDimension = Part.Parameter("L inter épau@Sketch1@Flex_flexible. Teil")
myDimension.SystemValue = i
Part.ClearSelection2 Wahr
boolstatus = Teil.ForceRebuild3(Wahr)
Festlegen von myModelView = Part.ActiveView
Warte
Weiter i
'boolstatus = Part.Extension.SelectByID2("Mittel [145-170mm]", "KONFIGURATIONEN", 0, 0, 0, Falsch, 0, Nichts, 0)
'boolstatus = Teil.ShowConfiguration2("Mittel [145-170mm]")
'boolstatus = Teil.ForceRebuild3(Wahr)
"Warte
'boolstatus = Part.Extension.SelectByID2("Groß [>175mm]", "KONFIGURATIONEN", 0, 0, 0, Falsch, 0, Nichts, 0)
'boolstatus = Part.ShowConfiguration2("Groß [>175mm]")
'boolstatus = Teil.ForceRebuild3(Wahr)
'Für i = 0,055 bis 0,145 Schritt 0,005
'boolstatus = Part.Extension.SelectByID2("Small@Flex_flexible. SLDPRT", "KONFIGURATIONEN", 0, 0, 0, Falsch, 0, Nichts, 0)
'boolstatus = Teil.ShowConfiguration2("Klein")
'boolstatus = Part.Extension.SelectByID2("L inter épau@Sketch1@Flex_flexible. SLDPRT", "DIMENSION", -7.48434662003883E-02, 0.151717758326748, -7.54569406310026E-02, falsch, 0, Nichts, 0)
'MyDimension als Objekt dimmen
'Set myDimension = Part.Parameter("L inter épau@Sketch1")
'myDimension.SystemValue = i
'boolstatus = Teil.ForceRebuild3(Wahr)
"Warte
'boolstatus = Teil.EditRebuild3()
"Als nächstes i
Ende Sub
Untergeordnet warten()
200 Schlafplätze
Ende Sub