.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Filter for Block References

3 REPLIES 3
Reply
Message 1 of 4
wynn1427
1269 Views, 3 Replies

Filter for Block References

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
3 REPLIES 3
Message 2 of 4
Anonymous
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
Message 3 of 4
wynn1427
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
Message 4 of 4
Anonymous
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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost