Home > Software engineering >  Questions about AUTOCAD selection
Questions about AUTOCAD selection

Time:09-16

Why can only run to modify "pole" layer, the layer is not good and error

Sub test ()
Dim sSet As AcadSelectionSet, Pnt As AcadPoint, series As AcadBlockReference, Ent As AcadEntity
'On the Error Resume Next
The Set sSet=ThisDrawing. SelectionSets. Add (" TEST ")
SSet. Clear
SSet. SelectOnScreen
For Each Ent In sSet
The Select Case Ent. Layer
Case "pole"
The Set of Pnt=Ent
Set a series=ThisDrawing. Application. The ActiveDocument. ModelSpace. InsertBlock (Pnt) Coordinates, "gc170", 1, 1, 1, 0)
A series of Layer="GXYZ
"Case "lights"
The Set of Pnt=Ent
Set a series=ThisDrawing. Application. The ActiveDocument. ModelSpace. InsertBlock (Pnt) Coordinates, "097", 1, 1, 1, 0)
A series of Layer="DLDW
"In Case the Else
End the Select
Next
SSet. Delete
'MsgBox "OK"
End Sub

CodePudding user response:

Don't pop around BBS now?

CodePudding user response:

Mainly is the problem to be combined with CAD, no environment
And also don't say what wrong
Personal experience: ask questions part of Chinese characters are not trigger word wrap, big probability can not solve,

CodePudding user response:

This problem I solved
  •  Tags:  
  • VBA
  • Related