.NET

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

Filter for Block References

435 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 (435 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 (435 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 (435 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!