.NET

Reply
Active Member
wynn1427
Posts: 6
Registered: ‎08-31-2006
Message 1 of 4 (432 Views)

Filter for Block References

432 Views, 3 Replies
08-31-2006 02:23 PM
I can't seem to come across the way to properly filter Block References in a certain drawing in ACAD 2007.

The code below filters for all the MText properly, but when filtering for block references named "sdet" (noticed all blockes text is lower case when inserted into autocad), I keep getting a count of zero.

Does anyone have a link for all the DXF filter codes, seems that the help only gives the most common ones?

*****************
FilterType(0) = 0
FilterData(0) = "MText"

STEXT.Select(AutoCAD.AcSelect.acSelectionSetAll, , , FilterType, FilterData)
NumSTEXT = STEXT.Count

FilterType2(0) = 0
FilterData2(0) = "Block Reference"
FilterType2(1) = 2
FilterData2(1) = "sdet"

SDET.Select(AutoCAD.AcSelect.acSelectionSetAll, , , FilterType2, FilterData2)
NumSDET = SDET.Count
*************

Thanks
Wynn
*T.Willey
Message 2 of 4 (432 Views)

Re: Filter for Block References

08-31-2006 02:38 PM in reply to: wynn1427
The dxf code for blocks is 'INSERT'. You can do something like

(defun c:Elist (/ ent)

(if (setq Ent (entsel))
(foreach i (entget (car Ent))
(print i)
)
)
(princ)
)

This will show the entity code for an object selected.

--

Tim
"A blind man lets nothing block his vision."


wrote in message news:5314720@discussion.autodesk.com...
I can't seem to come across the way to properly filter Block References in a
certain drawing in ACAD 2007.

The code below filters for all the MText properly, but when filtering for
block references named "sdet" (noticed all blockes text is lower case when
inserted into autocad), I keep getting a count of zero.

Does anyone have a link for all the DXF filter codes, seems that the help
only gives the most common ones?

*****************
FilterType(0) = 0
FilterData(0) = "MText"

STEXT.Select(AutoCAD.AcSelect.acSelectionSetAll, , , FilterType,
FilterData)
NumSTEXT = STEXT.Count

FilterType2(0) = 0
FilterData2(0) = "Block Reference"
FilterType2(1) = 2
FilterData2(1) = "sdet"

SDET.Select(AutoCAD.AcSelect.acSelectionSetAll, , , FilterType2,
FilterData2)
NumSDET = SDET.Count
*************

Thanks
Wynn
Active Member
wynn1427
Posts: 6
Registered: ‎08-31-2006
Message 3 of 4 (432 Views)

Re: Filter for Block References

08-31-2006 03:10 PM in reply to: wynn1427
Tim it works now. Nice lsp routine, more info than the help file gave on these codes from what I could find.

*****It now reads
FilterType(0) = 0
FilterData(0) = "MText"

STEXT.Select(AutoCAD.AcSelect.acSelectionSetAll, , , FilterType, FilterData)
NumSTEXT = STEXT.Count

-------Optional Filter option - Seems to be same speed as insert------
'FilterType2(0) = 100
'FilterData2(0) = "AcDbBlockReference"
---------------------------------------------------------
FilterType2(0) = 0
FilterData2(0) = "Insert"
FilterType2(1) = 2
FilterData2(1) = "sdet"

SDET.Select(AutoCAD.AcSelect.acSelectionSetAll, , , FilterType2, FilterData2)
NumSDET = SDET.Count
*******

Thanks
Wynn
*T.Willey
Message 4 of 4 (432 Views)

Re: Filter for Block References

08-31-2006 03:22 PM in reply to: wynn1427
You're welcome. I'm just learning .Net, but have a background in Lisp.
Looking forward to the C# .Net world.

--

Tim
"A blind man lets nothing block his vision."


wrote in message news:5314771@discussion.autodesk.com...
Tim it works now. Nice lsp routine, more info than the help file gave on
these codes from what I could find.

*****It now reads
FilterType(0) = 0
FilterData(0) = "MText"

STEXT.Select(AutoCAD.AcSelect.acSelectionSetAll, , , FilterType,
FilterData)
NumSTEXT = STEXT.Count

-------Optional Filter option - Seems to be same speed as insert------
'FilterType2(0) = 100
'FilterData2(0) = "AcDbBlockReference"
---------------------------------------------------------
FilterType2(0) = 0
FilterData2(0) = "Insert"
FilterType2(1) = 2
FilterData2(1) = "sdet"

SDET.Select(AutoCAD.AcSelect.acSelectionSetAll, , , FilterType2,
FilterData2)
NumSDET = SDET.Count
*******

Thanks
Wynn
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.