SelectOnScreen to get block attributes

SelectOnScreen to get block attributes

Anonymous
Not applicable
420 Views
3 Replies
Message 1 of 4

SelectOnScreen to get block attributes

Anonymous
Not applicable
Hi,

I can use the GetSubEntity method to select one block attribute (the
attribute, not the block) is there a way to use the SelectOnScreen method to
get both text entities and block attributes?

Any assistance will be appreciated.

Dim SSText As AcadSelectionSet
Dim FilterType(0 To 4) As Integer
Dim FilterData(0 To 4) As Variant

Set SSText = ThisDrawing.SelectionSets.add("SS-text")
FilterType(0) = -4
FilterData(0) = " FilterType(1) = 0
FilterData(1) = "TEXT"
FilterType(2) = 0
FilterData(2) = "Mtext"
FilterType(3) = 2
FilterData(3) = "AcDbAttribute" ' this does not work.
FilterType(4) = -4
FilterData(4) = "or>"
SSText.SelectOnScreen FilterType, FilterData

Regards

Sean Bartleet
0 Likes
421 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Sean Bartleet had this to say
:
> Hi,
>
> I can use the GetSubEntity method to select one block attribute (the
> attribute, not the block) is there a way to use the SelectOnScreen
> method to get both text entities and block attributes?

No. You may select AttributeDefinition objects but to access
AttributeReference obects programmatically, you must first select the
block references that contain the attributes you wish to edit, then call
that block's GetAttributes method.

Also, you can simplify your filter greatly:

Dim fType(0) As Integer, fData(0)
fType(0) = 0: fData(0) = "TEXT,MTEXT,INSERT"

--
Someone left the grass out in the yard all night.
http://www.acadx.com
0 Likes
Message 3 of 4

Anonymous
Not applicable
Those are the kinds of shortcuts in coding I look for. Awesome, Frank.
Thanks.

Keith


"Frank Oquendo" wrote in message
news:FD52F5EFAE27A557C38241B23BF23367@in.WebX.maYIadrTaRb...
> Sean Bartleet had this to say
>

>
> Also, you can simplify your filter greatly:
>
> Dim fType(0) As Integer, fData(0)
> fType(0) = 0: fData(0) = "TEXT,MTEXT,INSERT"
>
> --
> Someone left the grass out in the yard all night.
> http://www.acadx.com
>
>
0 Likes
Message 4 of 4

Anonymous
Not applicable
Hi,

Thanks for the clarification, boo hoo.

And thanks for the code simplification suggestion.

Regards.

Sean Bartleet

"Frank Oquendo" wrote in message
news:FD52F5EFAE27A557C38241B23BF23367@in.WebX.maYIadrTaRb...
> Sean Bartleet had this to say
> :
> > Hi,
> >
> > I can use the GetSubEntity method to select one block attribute (the
> > attribute, not the block) is there a way to use the SelectOnScreen
> > method to get both text entities and block attributes?
>
> No. You may select AttributeDefinition objects but to access
> AttributeReference obects programmatically, you must first select the
> block references that contain the attributes you wish to edit, then call
> that block's GetAttributes method.
>
> Also, you can simplify your filter greatly:
>
> Dim fType(0) As Integer, fData(0)
> fType(0) = 0: fData(0) = "TEXT,MTEXT,INSERT"
>
> --
> Someone left the grass out in the yard all night.
> http://www.acadx.com
>
>
0 Likes