Jump to content
callvey

VBA Selction sets. Select a list of blocks that exist on a specific layer

Recommended Posts

callvey

Hi

 

I have this code;

 

Sub selectABlockOnALayer()

Dim sset As AcadSelectionSet

Set sset = ThisDrawing.SelectionSets.Add("EXCEPTIONS-BLOCK3")

 

Dim filterType As Variant

Dim filterData As Variant

Dim p1(0 To 2) As Double

Dim p2(0 To 2) As Double

 

Dim grpCode(0 To 1) As Integer

grpCode(0) = 8

grpCode(1) = 2

filterType = grpCode

 

Dim grpValue(0 To 1) As Variant

grpValue(0) = "FXPM"

grpValue(1) = "4PLUG"

filterData = grpValue

 

sset.Select acSelectionSetAll, p1, p2, filterType, filterData

 

Debug.Print "Entities: " & str(sset.count)

 

sset.Delete

 

End Sub

I understand the code only selects 1 type of block on a layer but I cant even get that to work!

 

I am trying to select 89 different types of block that exist on a specific layer.

 

Is this something that can be done using VB?

 

Any advice would be great.

 

Thanks

 

Tom

Share this post


Link to post
Share on other sites
BlackBox

You should be able to glean what you need from this thread.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...