Hallo zusammen,
ich versuche gerade mittels VBA ein Sweeping im AutoCAD zu erstellen:
Ich habe mit dem Codebeispiel aus der Hilfe herumgespielt und habe nun folgendes Problem.
Anstelle eines Splines möchte ich das Objekt an einer Polylinie sweepen. Über VBA funktioniert dies aber nicht, ich bekomme als Fehlermeldung: "Allgemeiner Modellierungsfehler"
Mache ich den Vorgang von Hand direkt in AutoCAD funktioniert es einwadnfrei.
In der Hilfe zu "AddExtrudeSolidAlongPath" steht, dass als Pfad eine Polylinie zulässig ist.
Hat eventuell jemand eine Idee woran das liegen könnte??
Hier der leicht geänderte Beispielcode Code:
Code:
Sub Example_AddExtrudedSolidAlongPath()
' This example extrudes a solid from a region
' along a path defined by a spline.
' The region is created from an arc and a line.
Dim curves(0 To 1) As AcadEntity ' Define the arc
Dim centerPoint(0 To 2) As Double
Dim radius As Double
Dim startAngle As Double
Dim endAngle As Double
centerPoint(0) = 5#: centerPoint(1) = 3#: centerPoint(2) = 0#
radius = 2#
startAngle = 0
endAngle = 3.141592
Set curves(0) = ThisDrawing.ModelSpace.AddArc(centerPoint, radius, startAngle, endAngle)
' Define the line
Set curves(1) = ThisDrawing.ModelSpace.AddLine(curves(0).StartPoint, curves(0).EndPoint)
' Create the region
Dim regionObj As Variant
regionObj = ThisDrawing.ModelSpace.AddRegion(curves)
' Define the extrusion path (spline object)
Dim Polyobj As AcadPolyline
Dim fitPoints(0 To 5) As Double
' Define the Spline Object
fitPoints(0) = 0: fitPoints(1) = 10: fitPoints(2) = 10
fitPoints(3) = 10: fitPoints(4) = 10: fitPoints(5) = 10
Set Polyobj = ThisDrawing.ModelSpace.AddPolyline(fitPoints)
' Create the solid
Dim solidObj As Acad3DSolid
Set solidObj = ThisDrawing.ModelSpace.AddExtrudedSolidAlongPath(regionObj(0), Polyobj)
ZoomAll
End Sub
Gruss Dennis
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP