Adding dimensions to selection sets.

Adding dimensions to selection sets.

Anonymous
Not applicable
223 Views
5 Replies
Message 1 of 6

Adding dimensions to selection sets.

Anonymous
Not applicable
Hi there,

Could someone help point me the right direction please.
I am trying to select all the dimension's and text within a drawing so that
I can update the dimscale.
I am presuming that I need to build a selection set, but I cannot fatham how
to filter just the dimensions and text. !

Thanks
Dave
0 Likes
224 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
hi dave

within vb/a you have to build 2 (or more) selections, one for "DIMENSION",
one for "TEXT" (and/or "MTEXT")

regards, alfred

--
___________________________________________________________
Alfred Neswadba
Ingenieur Studio HOLLAUS
A-3100 St.Poelten, Brandstroemg. 6..... +43 699 21807303
Internet ................................ www.hollaus.at
E-Mail ...................... alfred.neswadba@hollaus.at
___________________________________________________________

"Dave Wilkinson" schrieb im Newsbeitrag
news:D67F21A123B706ACB7AB4E7513DB9420@in.WebX.maYIadrTaRb...
> Hi there,
>
> Could someone help point me the right direction please.
> I am trying to select all the dimension's and text within a drawing so
that
> I can update the dimscale.
> I am presuming that I need to build a selection set, but I cannot fatham
how
> to filter just the dimensions and text. !
>
> Thanks
> Dave
>
0 Likes
Message 3 of 6

Anonymous
Not applicable
but how do I filter just the dimensions ?
I have used a filter previously to get block information using DXFdata and
DXFcode, but am not sure how to go about the dimensions ????

Thanks
Dave

"Alfred Neswadba" wrote in message
news:51F924AFF06F045B2A7C419EA7C22158@in.WebX.maYIadrTaRb...
> hi dave
>
> within vb/a you have to build 2 (or more) selections, one for "DIMENSION",
> one for "TEXT" (and/or "MTEXT")
>
> regards, alfred
>
> --
> ___________________________________________________________
> Alfred Neswadba
> Ingenieur Studio HOLLAUS
> A-3100 St.Poelten, Brandstroemg. 6..... +43 699 21807303
> Internet ................................ www.hollaus.at
> E-Mail ...................... alfred.neswadba@hollaus.at
> ___________________________________________________________
>
> "Dave Wilkinson" schrieb im Newsbeitrag
> news:D67F21A123B706ACB7AB4E7513DB9420@in.WebX.maYIadrTaRb...
> > Hi there,
> >
> > Could someone help point me the right direction please.
> > I am trying to select all the dimension's and text within a drawing so
> that
> > I can update the dimscale.
> > I am presuming that I need to build a selection set, but I cannot fatham
> how
> > to filter just the dimensions and text. !
> >
> > Thanks
> > Dave
> >
>
0 Likes
Message 4 of 6

Anonymous
Not applicable
Option Explicit
Dim acad_doc As AcadDocument

Public Sub mytest()
Dim t_sset As AcadSelectionSet
Dim dxfcode(0) As Integer
Dim dxfvalue(0) As Variant

On Error GoTo FUNC_EXIT

Set acad_doc = ThisDrawing 'if you are not in vba, then replace
thisdrawing with your document

'create selection set in drawing
On Error Resume Next
Set t_sset = acad_doc.SelectionSets.Add("my_sset")
If Err Then
Err.Clear
Set t_sset = acad_doc.SelectionSets("my_sset")
t_sset.Clear
End If

'now get entities
dxfcode(0) = 0
dxfvalue(0) = "DIMENSION" 'that is the dxfcode for dimenstions
t_sset.Select acSelectionSetAll, , , dxfcode, dxfvalue

On Error GoTo FUNC_EXIT
MsgBox t_sset.Count

FUNC_EXIT:
On Error Resume Next
If Err Then MsgBox Err.Number & " / " & Err.Description
acad_doc.SelectionSets("my_sset").Delete
Set t_sset = Nothing
Set acad_doc = Nothing
Err.Clear
On Error GoTo 0
End Sub

regards, alfred

--
___________________________________________________________
Alfred Neswadba
Ingenieur Studio HOLLAUS
A-3100 St.Poelten, Brandstroemg. 6..... +43 699 21807303
Internet ................................ www.hollaus.at
E-Mail ...................... alfred.neswadba@hollaus.at
___________________________________________________________

"Dave Wilkinson" schrieb im Newsbeitrag
news:FE4EAA502D38EE150F4749CA4A97DAC1@in.WebX.maYIadrTaRb...
> but how do I filter just the dimensions ?
> I have used a filter previously to get block information using DXFdata and
> DXFcode, but am not sure how to go about the dimensions ????
>
> Thanks
> Dave
>
> "Alfred Neswadba" wrote in message
> news:51F924AFF06F045B2A7C419EA7C22158@in.WebX.maYIadrTaRb...
> > hi dave
> >
> > within vb/a you have to build 2 (or more) selections, one for
"DIMENSION",
> > one for "TEXT" (and/or "MTEXT")
> >
> > regards, alfred
> >
> > --
> > ___________________________________________________________
> > Alfred Neswadba
> > Ingenieur Studio HOLLAUS
> > A-3100 St.Poelten, Brandstroemg. 6..... +43 699 21807303
> > Internet ................................ www.hollaus.at
> > E-Mail ...................... alfred.neswadba@hollaus.at
> > ___________________________________________________________
> >
> > "Dave Wilkinson" schrieb im Newsbeitrag
> > news:D67F21A123B706ACB7AB4E7513DB9420@in.WebX.maYIadrTaRb...
> > > Hi there,
> > >
> > > Could someone help point me the right direction please.
> > > I am trying to select all the dimension's and text within a drawing so
> > that
> > > I can update the dimscale.
> > > I am presuming that I need to build a selection set, but I cannot
fatham
> > how
> > > to filter just the dimensions and text. !
> > >
> > > Thanks
> > > Dave
> > >
> >
>
0 Likes
Message 5 of 6

Anonymous
Not applicable
Thanks Alfred
I have found the dxf group codes in the help after looking for "DIMENSION"
as you have shown in your code.

Thanks once again for putting on the right track

Dave

"Alfred Neswadba" wrote in message
news:015E1D8969FE81A9F98D6AED36223805@in.WebX.maYIadrTaRb...
> Option Explicit
> Dim acad_doc As AcadDocument
>
> Public Sub mytest()
> Dim t_sset As AcadSelectionSet
> Dim dxfcode(0) As Integer
> Dim dxfvalue(0) As Variant
>
> On Error GoTo FUNC_EXIT
>
> Set acad_doc = ThisDrawing 'if you are not in vba, then
replace
> thisdrawing with your document
>
> 'create selection set in drawing
> On Error Resume Next
> Set t_sset = acad_doc.SelectionSets.Add("my_sset")
> If Err Then
> Err.Clear
> Set t_sset = acad_doc.SelectionSets("my_sset")
> t_sset.Clear
> End If
>
> 'now get entities
> dxfcode(0) = 0
> dxfvalue(0) = "DIMENSION" 'that is the dxfcode for dimenstions
> t_sset.Select acSelectionSetAll, , , dxfcode, dxfvalue
>
> On Error GoTo FUNC_EXIT
> MsgBox t_sset.Count
>
> FUNC_EXIT:
> On Error Resume Next
> If Err Then MsgBox Err.Number & " / " & Err.Description
> acad_doc.SelectionSets("my_sset").Delete
> Set t_sset = Nothing
> Set acad_doc = Nothing
> Err.Clear
> On Error GoTo 0
> End Sub
>
> regards, alfred
>
> --
> ___________________________________________________________
> Alfred Neswadba
> Ingenieur Studio HOLLAUS
> A-3100 St.Poelten, Brandstroemg. 6..... +43 699 21807303
> Internet ................................ www.hollaus.at
> E-Mail ...................... alfred.neswadba@hollaus.at
> ___________________________________________________________
>
> "Dave Wilkinson" schrieb im Newsbeitrag
> news:FE4EAA502D38EE150F4749CA4A97DAC1@in.WebX.maYIadrTaRb...
> > but how do I filter just the dimensions ?
> > I have used a filter previously to get block information using DXFdata a
nd
> > DXFcode, but am not sure how to go about the dimensions ????
> >
> > Thanks
> > Dave
> >
> > "Alfred Neswadba" wrote in message
> > news:51F924AFF06F045B2A7C419EA7C22158@in.WebX.maYIadrTaRb...
> > > hi dave
> > >
> > > within vb/a you have to build 2 (or more) selections, one for
> "DIMENSION",
> > > one for "TEXT" (and/or "MTEXT")
> > >
> > > regards, alfred
> > >
> > > --
> > > ___________________________________________________________
> > > Alfred Neswadba
> > > Ingenieur Studio HOLLAUS
> > > A-3100 St.Poelten, Brandstroemg. 6..... +43 699 21807303
> > > Internet ................................ www.hollaus.at
> > > E-Mail ...................... alfred.neswadba@hollaus.at
> > > ___________________________________________________________
> > >
> > > "Dave Wilkinson" schrieb im Newsbeitrag
> > > news:D67F21A123B706ACB7AB4E7513DB9420@in.WebX.maYIadrTaRb...
> > > > Hi there,
> > > >
> > > > Could someone help point me the right direction please.
> > > > I am trying to select all the dimension's and text within a drawing
so
> > > that
> > > > I can update the dimscale.
> > > > I am presuming that I need to build a selection set, but I cannot
> fatham
> > > how
> > > > to filter just the dimensions and text. !
> > > >
> > > > Thanks
> > > > Dave
> > > >
> > >
> >
>
0 Likes
Message 6 of 6

Anonymous
Not applicable
A suggestion: you create a selectionset with dimensions AND text (or also
MTEXT) with this:

dxfcode(0) = 0
dxfvalue(0) = "DIMENSION,TEXT,MTEXT"

Good luck,
--
Henk
0 Likes