I've created a context menu item in POP515: ID_Att_Info [&Attribuut info]^C^C-vbarun "UmmSearch (var as string)" I would like to pass on the attribute textstrings of the selected item to a procedure "Ummsearch ( var as string)" I have tried some things in VLisp (entget, ssget etc) but when selecting a blockreference, all I get is the block data and not the attribute data. Any ideas?
Here is how to extract Attribute(s). Public Function Get_Attr (str_Block, str_Attr) As String Dim intItems As Integer Dim MyBlock As AcadBlockReference str_Attr = "?" With ThisDrawing.ModelSpace For intItems = 0 to ThisDrawing.ModelSpace.count - 1 If .Item(intItems).EntityType = acBlockReference Then Set MyBlock = .Item(intItems) If str_Block = MyBlock.Name Then str_Attr = MyBlock.GetAttributes(0).TextString Exit For End If End If Next intItems End With Return str_Attr End Function -------------- Cheers Bob Shaw (www.bobscadshop.com)
Design the procedure *not* to accept the string as an argument, but rather use the Utility object's GetString method to ask for the string, and pass that via the macro: ^C^C-vbarun;UmmSearch;MyString -- R. Robert Bell, MCSE www.AcadX.com | I've created a context menu item in POP515: | | ID_Att_Info [&Attribuut info]^C^C-vbarun "UmmSearch (var as string)" | | I would like to pass on the attribute textstrings of the selected item to a procedure "Ummsearch ( var as string)" | | I have tried some things in VLisp (entget, ssget etc) but when selecting a blockreference, all I get is the block data and not the attribute data. | | Any ideas?