Anda di halaman 1dari 4

Add Centerlines through VBA - Autodesk Community http://forums.autodesk.com/t5/inventor-customization/add-centerlines-...

4 Unread liminma8458 Edit Account Preferences Sign Out Help


1 of 5 10/21/2016 4:05 AM
Add Centerlines through VBA - Autodesk Community http://forums.autodesk.com/t5/inventor-customization/add-centerlines-...

截 未命名


添加中心

Set oCentermark = oSheet.Centermarks(8)


Dim oCenterlinePt As GeometryIntent
Set oCenterlinePt = oSheet.CreateGeometryIntent(oCentermark)

oMarks.Add oCenterlinePt
Set oCentermark = oSheet.Centermarks(9)
Set oCenterlinePt = oSheet.CreateGeometryIntent(oCentermark)

oMarks.Add oCenterlinePt
Call oCenterlines.Add(oMarks)
oMarks.Clear

2 of 5 10/21/2016 4:05 AM
Add Centerlines through VBA - Autodesk Community http://forums.autodesk.com/t5/inventor-customization/add-centerlines-...

( )

截 未命名

截 未命名


Dim oDoc As DrawingDocument


Set oDoc = ThisApplication.ActiveDocument

' say you have a drawing curve segment selected on the sheet
Dim oSelectedCurve As DrawingCurve
Set oSelectedCurve = oDoc.SelectSet.Item(1).Parent

Dim oDrawingView As DrawingView


Set oDrawingView = oSelectedCurve.Parent

Dim oCurve As DrawingCurve


Dim iIndex As Integer
iIndex = 1

For Each oCurve In oDrawingView.DrawingCurves


If oCurve Is oSelectedCurve Then
Debug.Print "The selected drawing curve is the " & iIndex & "th curve on the drawing v

End If
iIndex = iIndex + 1
Next

3 of 5 10/21/2016 4:05 AM
Add Centerlines through VBA - Autodesk Community http://forums.autodesk.com/t5/inventor-customization/add-centerlines-...

, : ,

! ,
! ,

, ! , ,

4 of 5 10/21/2016 4:05 AM

Anda mungkin juga menyukai