这是我使用的代码- Private Sub insertmarkerBTN_Click()
- Dim blockX As AcadBlockReference 'Inserted block..
- Dim blockPoint As Variant ' Pick point for block insert..
- Dim HypS As AcadHyperlinks 'Hyperlinks collection for block..
- Dim Hyp As AcadHyperlink
- ThisDrawing.ActiveSpace = acModelSpace
- blockPoint = ThisDrawing.Utility.GetPoint(, vbCr & "Pick the insertion point for the Detail Reference Marker.. ")
- Set blockX = ThisDrawing.ModelSpace.InsertBlock(blockPoint, "ScaledFrame", 1#, 1#, 1#, 0)
- Set HypS = blockX.Hyperlinks
- Set Hyp = HypS.Add(ThisDrawing.Name)
- Hyp.URLNamedLocation = "2"
- Dim V As AcadView
- Dim L As AcadLayout
- Dim i As Integer
- For Each L In ThisDrawing.Layouts
- If Not UCase(L.Name) = "MODEL" Then
- i = i + 1
- ThisDrawing.ActiveLayout = L
- Set V = ThisDrawing.Views.Add(i)
- V.LayoutId = L.ObjectID
- End If
- Next
- End Sub
和;图形中的超链接会将您踢入布局2。添加的超链接似乎需要运行一次代码才能获得正确的thisdrawing。名称 |