Author Topic: Could not create an new selection set?  (Read 2728 times)

0 Members and 1 Guest are viewing this topic.

cjw

  • Guest
Could not create an new selection set?
« on: March 31, 2010, 09:52:05 PM »
Code: [Select]
(defun C:TT (/ I SS)
  (if (setq SS (ssget '((0 . "TEXT"))))
    (progn
      (setq I 0)
      (repeat 50
(if (= (rem (setq I (1+ I)) 2) 0)
 (command "._JUSTIFYTEXT" SS "" "L")
 (command "._JUSTIFYTEXT" SS "" "R")
)
      )
    )
  )
  (princ)
)

After use "TT" three times or more times.

Error: U:\develop\global\src\coreapps\etlib\utility.h@71 Could not create an new selection set

If "JUSTIFYTEXT" can not use "command" safely,how about other way?
May be write a function like "JUSTIFYTEXT".

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Could not create an new selection set?
« Reply #1 on: March 31, 2010, 11:27:30 PM »
have you tried previous?
Code: [Select]
(defun C:TT (/ I SS)
  (if (setq SS (ssget '((0 . "TEXT"))))
    (progn
      (setq I 0)
      (repeat 50
(if (= (rem (setq I (1+ I)) 2) 0)
  (command "._JUSTIFYTEXT" "_P" "" "L")
  (command "._JUSTIFYTEXT" "_P" "" "R")
)
      )
    )
  )
  (princ)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

cjw

  • Guest
Re: Could not create an new selection set?
« Reply #2 on: April 01, 2010, 12:55:30 AM »
have you tried previous?
Code: [Select]
(defun C:TT (/ I SS)
  (if (setq SS (ssget '((0 . "TEXT"))))
    (progn
      (setq I 0)
      (repeat 50
(if (= (rem (setq I (1+ I)) 2) 0)
  (command "._JUSTIFYTEXT" "_P" "" "L")
  (command "._JUSTIFYTEXT" "_P" "" "R")
)
      )
    )
  )
  (princ)
)

Thank you,CAB.

I have tried "previous"

The same problem.

It seems can't be solved.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Could not create an new selection set?
« Reply #3 on: April 01, 2010, 08:57:00 AM »
Quote
Could not create an new selection set
This would lead me to believe that there are no Plain Text to process.
Perhaps you need a better filter or maybe the text don't exist in your current tab.
Code: [Select]
(if (setq SS (ssget (list '(0 . "TEXT")(cons 410 (getvar "ctab")))))
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

qjchen

  • Bull Frog
  • Posts: 285
  • Best wishes to all
Re: Could not create an new selection set?
« Reply #4 on: April 01, 2010, 08:45:17 PM »
It is strange, the same to me.

but if as follows, it will work, maybe there are some other reasons for it.

Code: [Select]
(defun C:TT (/ I)
  (if (setq SS (ssget '((0 . "TEXT"))))
    (progn
      (setq I 0)
     
      (repeat 50
(if (= (rem (setq I (1+ I)) 2) 0)
(progn

  (
  (setq ss1 ss)
 
  (command "._JUSTIFYTEXT" SS1 "" "L"))
  (command "._JUSTIFYTEXT" SS1 "" "R")
)
)
      )
    )
  )
  (princ)
)
http://qjchen.mjtd.com
My blog http://chenqj.blogspot.com (Chinese, can be translate into English)

cjw

  • Guest
Re: Could not create an new selection set?
« Reply #5 on: April 01, 2010, 09:02:07 PM »
Quote
Could not create an new selection set
This would lead me to believe that there are no Plain Text to process.
Perhaps you need a better filter or maybe the text don't exist in your current tab.
Code: [Select]
(if (setq SS (ssget (list '(0 . "TEXT")(cons 410 (getvar "ctab")))))

The same fail result.

Quote
Error: U:\develop\global\src\coreapps\etlib\utility.h@71 Could not create an new selection set

In my view:
the problem is at "command" call “selection set” too much time,
and the “selection set” doesn't  clear,and the “selection set” have like "Capacity constraints".
Maybe.

Just don't know how to clear  “selection set”  after call  it.

cjw

  • Guest
Re: Could not create an new selection set?
« Reply #6 on: April 01, 2010, 09:13:14 PM »
It is strange, the same to me.

but if as follows, it will work, maybe there are some other reasons for it.

Code: [Select]
(defun C:TT (/ I)
  (if (setq SS (ssget '((0 . "TEXT"))))
    (progn
      (setq I 0)
     
      (repeat 50
(if (= (rem (setq I (1+ I)) 2) 0)
(progn

  (
  (setq ss1 ss)
 
  (command "._JUSTIFYTEXT" SS1 "" "L"))
  (command "._JUSTIFYTEXT" SS1 "" "R")
)
)
      )
    )
  )
  (princ)
)

The same fail result.

cjw

  • Guest
Re: Could not create an new selection set?
« Reply #7 on: April 01, 2010, 09:19:13 PM »
My point of view is not quite right.

Try this code,it work fine.
Code: [Select]
(defun C:TT (/ I SS)
  (if (setq SS (ssget (list '(0 . "TEXT"))))
    (progn
      (setq I 0)
      (repeat 50
(command "._MOVE" SS "" "@" "@")
      )
    )
  )
  (princ)
)

May be the "JUSTIFYTEXT" have bug.


alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Could not create an new selection set?
« Reply #8 on: April 01, 2010, 10:25:49 PM »
Isn't there a Garbage Collection or something that can be used?
I ran this 3 times, then just executing JustifyText wouldn't continue and if I tried to create a selection set with (ssget) it would give me: exceeded maximum number of selection sets.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

cjw

  • Guest
Re: Could not create an new selection set?
« Reply #9 on: April 02, 2010, 12:49:54 AM »
Isn't there a Garbage Collection or something that can be used?
I ran this 3 times, then just executing JustifyText wouldn't continue and if I tried to create a selection set with (ssget) it would give me: exceeded maximum number of selection sets.
Yes,alanjt
As you found.
"Garbage Collection" sounds nice. is there??

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Could not create an new selection set?
« Reply #10 on: April 02, 2010, 12:56:11 AM »
don't know if this will solve your problem, but in the remote chance it might:

Code: [Select]
(defun c:PurgeSelectionSets ( / picksets )

    (foreach pickset
    
        (setq picksets
            (vl-remove-if-not
               '(lambda ( symbol ) (eq 'pickset (type (eval symbol))))
                (atoms-family 0)
            )
        )    
        
        (princ
            (strcat
                "Purging <"
                (vl-symbol-name pickset)
                ">\n"
            )
        )
        
        (set pickset nil)
        
    )
    
    (princ
        (strcat
            "Purged "
            (itoa (length picksets))
            " selection set(s)."
        )
    )
    
    (princ)

)

also see this thread
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

qjchen

  • Bull Frog
  • Posts: 285
  • Best wishes to all
Re: Could not create an new selection set?
« Reply #11 on: April 02, 2010, 02:35:31 AM »
It is strange, the same to me.

but if as follows, it will work, maybe there are some other reasons for it.

Code: [Select]
(defun C:TT (/ I)
  (if (setq SS (ssget '((0 . "TEXT"))))
    (progn
      (setq I 0)
     
      (repeat 50
(if (= (rem (setq I (1+ I)) 2) 0)
(progn

  (
  (setq ss1 ss)
 
  (command "._JUSTIFYTEXT" SS1 "" "L"))
  (command "._JUSTIFYTEXT" SS1 "" "R")
)
)
      )
    )
  )
  (princ)
)

The same fail result.


:) This error not always exist, When I use the modified code in a new dwg, it is ok in my PC.

so somewhat strange, maybe you are right, the "justifytext" command has bug.

Here, http://discussion.autodesk.com/forums/thread.jspa?threadID=350022

Jürg Menzi also says "I've not the time to explain all details, but the main error source was the command 'justifytext'. Changed the function to ActiveX. "

« Last Edit: April 02, 2010, 02:38:35 AM by yuanqiu »
http://qjchen.mjtd.com
My blog http://chenqj.blogspot.com (Chinese, can be translate into English)

cjw

  • Guest
Re: Could not create an new selection set?
« Reply #12 on: April 02, 2010, 03:35:33 AM »
It is strange, the same to me.

but if as follows, it will work, maybe there are some other reasons for it.

Code: [Select]
(defun C:TT (/ I)
  (if (setq SS (ssget '((0 . "TEXT"))))
    (progn
      (setq I 0)
     
      (repeat 50
(if (= (rem (setq I (1+ I)) 2) 0)
(progn

  (
  (setq ss1 ss)
 
  (command "._JUSTIFYTEXT" SS1 "" "L"))
  (command "._JUSTIFYTEXT" SS1 "" "R")
)
)
      )
    )
  )
  (princ)
)

The same fail result.


:) This error not always exist, When I use the modified code in a new dwg, it is ok in my PC.

so somewhat strange, maybe you are right, the "justifytext" command has bug.

Here, http://discussion.autodesk.com/forums/thread.jspa?threadID=350022

Jürg Menzi also says "I've not the time to explain all details, but the main error source was the command 'justifytext'. Changed the function to ActiveX. "



Your help is very much appreciated.
Thank You Thank You
 :-D