SelectOnScreen Win7-64bit with Version 2011 Acad.

SelectOnScreen Win7-64bit with Version 2011 Acad.

fxcastil
Advocate Advocate
728 Views
4 Replies
Message 1 of 5

SelectOnScreen Win7-64bit with Version 2011 Acad.

fxcastil
Advocate
Advocate

Has anybody used the SelectOnScreen method of creating a selection set in AutoCAD 2011.

 

I have been using the same VBA code in version 2005-2008 without a problem, so I am guessing the problem is with

version 2011.  This is the first time time to this VBA code in Win7-64 Bit with 2011 AutoCad.

 

Code snippet below

 

*********************************************

 

 

' the user is selecting text or Mtext from the screen

If strType = "Text" Then

   ReDim intFltrCode(3) As Integer
   ReDim varFltrVal(3) As Variant
     
      intFltrCode(0) = -4:   varFltrVal(0) = "<OR"
      intFltrCode(1) = 0:    varFltrVal(1) = "TEXT"
      intFltrCode(2) = 0:   varFltrVal(2) = "MTEXT"
      intFltrCode(3) = -4:   varFltrVal(3) = "OR>"
  
End If

 

   
 ' call selection set function which creates new selection set and erases old
     Set objSelSet = ChkSelSet(strSetName)
     
       
 ' Prompts the user to select entity  from drawing based on filter

****************************  error is generated here ******************************************

         objSelSet.SelectOnScreen intFltrCode, varFltrVal

 


          

0 Likes
729 Views
4 Replies
Replies (4)
Message 2 of 5

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> so I am guessing the problem is withversion 2011

Could you please tell us, what problem you do have? What error-message, at least the number?

 

I tried this code with AutoCAD 2011x64 (on Win7x64):

   Dim intFltrCode(0) As Integer
   Dim varFltrVal(0) As Variant
   intFltrCode(0) = 0:   varFltrVal(0) = "TEXT,MTEXT"
         
   Dim objSelSet As AcadSelectionSet
   Set objSelSet = ThisDrawing.SelectionSets.Add("TSTSELSET")
   
   objSelSet.SelectOnScreen intFltrCode, varFltrVal

I did not built in the check, if a SelectionSet with this name does exist, so that has to built in.

I show how you can do an "OR"-filter without using "<OR" ..."OR>"

 

....and my code runs without exception. So I guess that the base of your problem is placed in that part of code you did not show (for example where the SelectionSet is created?

 

- alfred -

 

 

 

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 5

fxcastil
Advocate
Advocate

The error message is

 

Run Time Error '-2147418113

 

AUTOMATION ERROR

CATASTROPHIC FAILURE

 

0 Likes
Message 4 of 5

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

does my code run on your AutoCAD?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 5 of 5

fxcastil
Advocate
Advocate

I get the same error with your code as well.

 

Are you using you sample code inside a user-form? In other words can you use a button-click to start your lines of code?

 

The problem seems to be be when using a user-form to allow the operator/user to start the SelectOnScreen method.

 

I have read other posts about the same problem I am having.

 

 

 

 

0 Likes