- UID
- 68603
- 积分
- 144
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2003-7-30
- 最后登录
- 1970-1-1
|
发表于 2007-5-31 21:09:48
|
显示全部楼层
vba有自己的缺陷!
Re: Grips of a line
"dlutzow" wrote in message
news:f0a84a8.-1@WebX.maYIadrTaRb...
> How can I display the grips of a line. I am using Acad2000 and VB 6. In
VisualLISP you can use the function (sssetfirst arg1 arg2). Can anyone
please help me.
The only way to do this in VBA is by using AcadX.arx
(www.caddzone.com/acadx/acadx.htm).
You must implement your code as a command using the
AcadXEditorCommand class, and from within the command's
Execute() event handler, you can assign the selection
set containing the objects to be left gripped and
selected to the ActiveSelectionSet property of the
AcadXDrawingEditor class.
Here is a simple demo that implements a command called
VBEXPLODE, which will explode a selected LWPOLYLINE and
leave the resulting entities gripped and selected:
'---------------------------------------------------------
Public WithEvents cmdExplode As AcadXEditorCommand
Public Sub InitApplication()
Dim Editor As New AcadXDrawingEditor
Set cmdExplode = Editor.AddCommand("VBEXPLODE")
cmdExplode.Enabled = False
cmdExplode.Transparent = False
cmdExplode.NoPerspective = True
cmdExplode.RedrawPickFirst = True
cmdExplode.Enabled = True
End Sub
Private Sub cmdExplode_Execute(Context As ACADXLib.IAcadXDocumentContext)
Dim Ent As AcadEntity
Dim Pt As Variant
Dim Polyline As AcadLWPolyline
On Error GoTo Done
Context.Document.Utility.GetEntity Ent, Pt, "Select LWPolyline: "
Set Polyline = Ent
Context.Command Array("._EXPLODE", Polyline)
Dim Editor As New AcadXDrawingEditor
Editor.ActiveSelectionSet = Context.Document.ActiveSelectionSet
Done:
Err.Clear
End Sub
'--------------------------------------------------------- |
|