bigr1822 Posted August 12, 2011 Posted August 12, 2011 Anyone have any ideas what I am doing wrong with this code? I keep getting a error, "Invalid argument FilterType in Select" at this point in my code. mySS.Select(AcSelect.acSelectionSetAll, , , GrpC, GrpV) [html] I have a block in my drawing that I am trying to show. The block is called ASTAMP. It is in the drawing, and I am not sure what I am doing wrong to make this blow up. Public Sub ShowBlock(ByVal ThisDrawing As AcadDocument) Dim mySS As AcadSelectionSet Dim GrpC(4) As Object Dim GrpV(4) As Object Dim myBlkRef As AcadBlockReference GrpC(0) = 0 : GrpV(0) = "INSERT" GrpC(1) = -4 : GrpV(1) = "<or" GrpC(2) = 2 : GrpV(2) = "ASTAMP" GrpC(3) = -4 : GrpV(3) = "or>" GrpC(4) = 67 : GrpV(4) = 1 'paperspace On Error Resume Next ThisDrawing.SelectionSets.Item("TempSSett").Delete() mySS = ThisDrawing.SelectionSets.Add("TempSSett") mySS.Select(AcSelect.acSelectionSetAll, , , GrpC, GrpV) For Each myBlkRef In mySS myBlkRef.Visible = True myBlkRef.Update() Next mySS.Delete() End Sub Any ideas or leads would be greatly appreciated. Rodney Quote
bigr1822 Posted August 12, 2011 Author Posted August 12, 2011 That seemed to stop me from getting the error, so thanks for that, but any ideas why it doesn't find my block. The count always says 0. The name is spelled correctly in my code and in the drawing??? Quote
BlackBox Posted August 12, 2011 Posted August 12, 2011 That seemed to stop me from getting the error, so thanks for that, but any ideas why it doesn't find my block. The count always says 0. The name is spelled correctly in my code and in the drawing??? What is the purpose of "" in your code, as you only list one DXF 2 parameter? ^^ I know what they do, I don't understand why their are included in your code. Separately, is the block dynamic, by chance? ... Are the Name and EffectiveName Properties the same? Quote
bigr1822 Posted August 12, 2011 Author Posted August 12, 2011 Separately, is the block dynamic, by chance? ... Are the Name and EffectiveName Properties the same? I don't know what you mean by this? The "OR" thing, you are probably right, I took them out. I did have more than one when I originally wrote this code in VBA. Quote
BlackBox Posted August 12, 2011 Posted August 12, 2011 Is your block dynamic? I ask, because when a block is dynamic the DXF 2 (Name) value is sometimes required to be "`*U*" (aka Anonymous), and therefor no longer selectable by the name. In LISP, we often use (2 . ",`*U*") in our selection set filter, because the dynamic block's DXF 2 value only changes onec the block's dynamic properties have changed. To see what I mean about the block's properties, paste this at your command line, then type "DUMP" + hit Enter: (defun c:DUMP ( / eName) (vl-load-com) (if (setq eName (car (entsel "\nSelect object: "))) (progn (textpage) (vlax-dump-object (vlax-ename->vla-object eName) T)) (prompt "\n** Nothing selected ** ")) (princ)) ... Select your block. What are the values of the properties listed above? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.