Selection set question

Selection set question

Anonymous
Not applicable
295 Views
8 Replies
Message 1 of 9

Selection set question

Anonymous
Not applicable
how do i make a selection set of all block references called 'Detail_Bubble'
out of all the layout tabs?

thanks,
Rob
vb6, a2k2, w2k
0 Likes
296 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
Dim ss As AcadSelectionSet
Set ss = ThisDrawing.PickFirstSelectionSet
ss.Clear
Dim ft(0 To 2) As Integer
Dim fd As Variant
ft(0) = 0
ft(1) = 2
ft(2) = 67
fd = Array("INSERT", "DETAIL_BUBBLE", 1)
ss.Select(acSelectionSetAll, , , ft, fd)

"Rob Tomson" wrote in message
news:BA2796A674E4AAF5F7A18DC7DD58A9E9@in.WebX.maYIadrTaRb...
> how do i make a selection set of all block references called
'Detail_Bubble'
> out of all the layout tabs?
>
> thanks,
> Rob
> vb6, a2k2, w2k
>
>
0 Likes
Message 3 of 9

Anonymous
Not applicable
wow, thanks! now how do i extract an attribute value from each block that
has the tag of 'DETAIL_NUMBER' and add it to a list box w/ no duplicates?



"Tony Tanzillo" wrote in message
news:84FD6D8B6A89B0A6B9D2F81E754AD40D@in.WebX.maYIadrTaRb...
> Dim ss As AcadSelectionSet
> Set ss = ThisDrawing.PickFirstSelectionSet
> ss.Clear
> Dim ft(0 To 2) As Integer
> Dim fd As Variant
> ft(0) = 0
> ft(1) = 2
> ft(2) = 67
> fd = Array("INSERT", "DETAIL_BUBBLE", 1)
> ss.Select(acSelectionSetAll, , , ft, fd)
>
> "Rob Tomson" wrote in message
> news:BA2796A674E4AAF5F7A18DC7DD58A9E9@in.WebX.maYIadrTaRb...
> > how do i make a selection set of all block references called
> 'Detail_Bubble'
> > out of all the layout tabs?
> >
> > thanks,
> > Rob
> > vb6, a2k2, w2k
> >
> >
>
>
0 Likes
Message 4 of 9

Anonymous
Not applicable
Iterate through the selection set, and use the GetAttributes() method
of each block reference to get an array of its attributes, then iterate
through the array to find the attribute whose TagString property equals
"DETAIL_NUMBER", and add the value of the TextString property to the
list box, if it is not already there.

"Rob Tomson" wrote in message
news:3D81F02EDF2673B1F0C0B894687F73C8@in.WebX.maYIadrTaRb...
> wow, thanks! now how do i extract an attribute value from each block that
> has the tag of 'DETAIL_NUMBER' and add it to a list box w/ no duplicates?
>
>
>
> "Tony Tanzillo" wrote in message
> news:84FD6D8B6A89B0A6B9D2F81E754AD40D@in.WebX.maYIadrTaRb...
> > Dim ss As AcadSelectionSet
> > Set ss = ThisDrawing.PickFirstSelectionSet
> > ss.Clear
> > Dim ft(0 To 2) As Integer
> > Dim fd As Variant
> > ft(0) = 0
> > ft(1) = 2
> > ft(2) = 67
> > fd = Array("INSERT", "DETAIL_BUBBLE", 1)
> > ss.Select(acSelectionSetAll, , , ft, fd)
> >
> > "Rob Tomson" wrote in message
> > news:BA2796A674E4AAF5F7A18DC7DD58A9E9@in.WebX.maYIadrTaRb...
> > > how do i make a selection set of all block references called
> > 'Detail_Bubble'
> > > out of all the layout tabs?
> > >
> > > thanks,
> > > Rob
> > > vb6, a2k2, w2k
> > >
> > >
> >
> >
>
>
0 Likes
Message 5 of 9

Anonymous
Not applicable
thanks! this is what i came up with, please comment:

If ss.Count > 0 Then
For i = 0 To ss.Count - 1
Set BlockRef = ss.Item(i)
BlockAtt = BlockRef.GetAttributes
For k = 0 To List1.ListCount
If List1.List(k) = BlockAtt(j).TextString Then
k = -1
Exit For
End If
Next k
If k <> -1 Then List1.AddItem BlockAtt(j).TextString
Next
End If

it works so i know it's correct but from a style and speed standpoint what
would you change? one more quick question: how do i make a filter that has
more than one block name in it (ex. 'detail_bubble-old' and
'detail_bubble-new')?

thanks for your help,
Rob
0 Likes
Message 6 of 9

Anonymous
Not applicable
I am trying to build a selection set to find the following text string but
VBA doesn't like the "" in the string. How would I do this?

vData(0) = "TEXT": vData(1) = "LABELED "EQUIPMENT GROUND""
0 Likes
Message 7 of 9

Anonymous
Not applicable
the vType is the group code and the vData is the corresponding value you
want to filter and if you want quotes in a string use \"
try this:

vType(0) = 0: vData(0) = "TEXT"
vType(1) = 1: vData(1) = "LABELED \"EQUIPMENT GROUND\""

ThisDrawing.PickfirstSelectionSet.Select acSelectionSetAll, , , vType,
vData

Rob
--
'There is no knowledge that is not power.'
W2k, A2K2, VB6, VB.NET, ADN (new)
"Chris W" wrote in message
news:253EBD3994C54C72C2363DF0BB0A2C3F@in.WebX.maYIadrTaRb...
> I am trying to build a selection set to find the following text string but
> VBA doesn't like the "" in the string. How would I do this?
>
> vData(0) = "TEXT": vData(1) = "LABELED "EQUIPMENT GROUND""
>
>
0 Likes
Message 8 of 9

Anonymous
Not applicable
I have a selection set and I'm cycling through each object in
it.  I want to change the scale of each object.  All of the objects
are dims, leaders, parts lists and boms (the last two are from MDT). 
The problem arises with the MDT objects.

 

When I type sset(i).Scale = 4# VBA won't allow it, saying
there's a "Compile Error, Expected: )".  If I use ScaleFactor (instead of
just Scale) VBA allows the line but it generates an error at run-time because it
should be Scale (I paused the program and checked the Locals Window and it said
"Scale" NOT "ScaleFactor."  What gives?  Why can't I type just
Scale?  BTW, if I type just Scale (without the 4#) the word Scale turns
blue, but the VBA and ACAD/MDT help doesn't have anything on
scale.

 

Can anyone help?

 

Seth
0 Likes
Message 9 of 9

Anonymous
Not applicable
I have a selection set and I'm cycling through each object in it. I want to
change the scale of each object. All of the objects are dims, leaders,
parts lists and boms (the last two are from MDT). The problem arises with
the MDT objects.

When I type sset(i).Scale = 4# VBA won't allow it, saying there's a "Compile
Error, Expected: )". If I use ScaleFactor (instead of just Scale) VBA
allows the line but it generates an error at run-time because it should be
Scale (I paused the program and checked the Locals Window and it said
"Scale" NOT "ScaleFactor." What gives? Why can't I type just Scale? BTW,
if I type just Scale (without the 4#) the word Scale turns blue, but the VBA
and ACAD/MDT help doesn't have anything on scale.

Can anyone help?

Seth
0 Likes