CAD/CAM discussion forum > CAD > Thisdrawing.Blocks

Thisdrawing.Blocks

    
  Subscribe Topic

Rank: 1

andre5511

Newbie

posts: 2

Registered: 2014-6-13

Message 1 of 2

 Thisdrawing.Blocks
13-06-2014 08:54 . pm   |   View his/her posts only
I've using Zwcad2014.

The code below isn´t working. The menssage is Run_time error '13': Type mismatch

Sub changeItensBlocks()
Dim Blo As ZcadBlock
Dim bl As ZcadBlockReference
Dim ent As ZcadEntity
Dim ss As ZcadSelectionSet
Dim ft(0) As Integer
Dim fd(0) As Variant


ft(0) = 2
For Each Blo In ThisDrawing.Blocks
fd(0) = Blo.Name
If Mid(Blo.Name, 1, 1) <> "*" Then
Set ent = Blo.Item(0)
On Error Resume Next
Set ss = ThisDrawing.SelectionSets("sele")
If Err Then
Err.Clear
Set ss = ThisDrawing.SelectionSets.Add("sele")
End If
ss.Clear
ss.Select zcSelectionSetAll, , , ft, fd
For Each bl In ss
bl.Layer = ent.Layer
bl.Update
Next
ss.Clear
ss.Delete
End If
Next
End Sub

What can I do to fix it?

Rank: 1

andre5511

Newbie

posts: 2

Registered: 2014-6-13

Message 2 of 2

13-06-2014 11:34 . pm   |   View his/her posts only
I got to fin the problem.

I wrote the cod again in new project.

Thanks
See also
X