progeCAD support, tips and troubleshooting forum. progeCAD works very similar to some versions of AutoCAD. Moderated.

Moderators: caddit, Moderators

#1705 by LJL
Fri Dec 02, 2011 1:08 am
I created a lisp routine that changes a selection of of text starting from a defined number and a defined step in the order of selection of the entities.

This lisp has worked in every version up until ProgeCAD 10/11 and after a number of tests it seems they have broken the selection set functionality. Instead of changing the text entities in the order of selection it changes them in the order of creation. This is not correct.

As far as I know SSGET is the only way to get a selection, stored in the order of selection. What have they done?

(there is nothing wrong with the lisp, it runs in ProgeCAD 08 and even in AutoCAD 2012 without modification).

Regards

#1710 by caddit
Tue Dec 06, 2011 7:16 am
LJL,


If you can post a specific AutoLISP example here we can refer it to a developer for a work-around. We can also try to make sure future versions are fixed.
#1778 by LJL
Mon Jun 04, 2012 1:19 am
Below I have the reply I received from ProgeCAD directly acknowledging the issue. I fail to see how rectifying the issue can be so hard as it was functioning correctly in previous versions. Why they would fiddle with how the LISP functions is beyond me.

Anyway I notice that there is still no fix in this latest update. Maybe a follow up from you guys would have more weight.

You can notice the issue by simply running the change command, by selecting a number of entities in an order you wish to change them. Regardless of the order you select them in they will follow the order of creation, not selection.

For interest the LISP I refer to is:

(defun C:seqnumm (/ ss sfx pfx cmb)
(setq cnt (getint "\nEnter number you wish to start from <1>:"))
(setq stp (getint "\nEnter number to step <1>:"))
(if (= cnt nil) (setq cnt 1))
(if (= stp nil) (setq stp 1))
(initget "p s P S")
(setq spq (getstring "\nDo you want a <P>refix or <S>uffix -Return for no :"))
(setq spq (strcase spq))
(if (= spq "P") (setq sfx (getstring t "\nEnter prefix :")))
(if (= spq "S") (setq pfx (getstring t "\nEnter suffix :")))
(prompt "\nEntity selection for SeqNum command :-")
(setq loop "x")
(setq ss (ssget)) ; Gets entities
(setq sn (sslength ss))
(setq index 0)
(while loop
(setq n (ssname ss index))
(setq cmb cnt)
(if (= spq "P")
(progn
(setq cnv (itoa cnt))
(setq cmb (strcat sfx cnv))
)
)
(if (= spq "S")
(progn
(setq cnv (itoa cnt))
(setq cmb (strcat cnv pfx))
)
)
(command "change" n "" "" "" "" "" "" cmb) ; Change entity
(setq index (+ index 1))
(setq cnt (+ cnt stp))
(if (= sn index) (setq loop nil))
)
)


Thanks
Luke
___________________________________
Reply from ProgeCAD:

Hello Luke,

we verified the occurring issue employing the ssget lisp function, the selection order not being maintained.
It was reported to the Development Office, they will look at it trying to identify an available solution.

It is still not defined when the issue will solve.
Thank you for your report.

Best Regards
--
Salvatore PAGANI
progeCAD Technical Support
progeCAD - CAD Solutions
#1780 by caddit
Wed Jun 13, 2012 5:57 am
Dear LJL,


No, this problem is not just the fault of ssget. This is the result of basic progeCAD select sort-order behaviour - progeCAD has always sorted selection sets by order of their creation. In your case, it is possible to code specific AutoLISP procedures to avoid this behavior.

As an example, see the "progecad_ssget" subroutine below which provides text numbering to facilitate sort-by-selection-order. The limitation for this example is that it only accepts single-selection of one entity at time:

Code: Select all(defun C:seqnumm (/ ss sfx pfx cmb)
  (setq cnt (getint "\nEnter number you wish to start from <1>:"))
  (setq stp (getint "\nEnter number to step <1>:"))
  (if (= cnt nil) (setq cnt 1))
  (if (= stp nil) (setq stp 1))
  (initget "p s P S")
  (setq spq (getstring "\nDo you want a <P>refix or <S>uffix -Return for no :"))
  (setq spq (strcase spq))
  (if (= spq "P") (setq sfx (getstring t "\nEnter prefix :")))
  (if (= spq "S") (setq pfx (getstring t "\nEnter suffix :")))
  (prompt "\nEntity selection for SeqNum command :-")
  (setq loop "x")
  ;(setq ss (ssget)) ; Gets entities
  (setq ss (progecad_ssget)) ; Gets entities
  (setq sn (sslength ss))
  (setq index 0)
  (while loop
    (setq n (ssname ss index))
    (setq cmb cnt)
    (if (= spq "P")
      (progn
        (setq cnv (itoa cnt))
        (setq cmb (strcat sfx cnv))
      )
    )
    (if (= spq "S")
      (progn
        (setq cnv (itoa cnt))
        (setq cmb (strcat cnv pfx))
      )
    )
    (command "change" n "" "" "" "" "" "" cmb) ; Change entity
    (setq index (+ index 1))
    (setq cnt (+ cnt stp))
    (if (= sn index) (setq loop nil))
  )
)


(defun progecad_ssget( / main_group grp ent)
  (setq main_group (ssadd))
 
  (while (setq ent (car (entsel)))
    (ssadd ent main_group)
    (redraw ent 3)
  )
 
  (if (= (sslength main_group) 0)
    (setq main_group nil)
  )
main_group
);Enddef

#1787 by LJL
Wed Jul 04, 2012 11:29 pm
That is not true..

Open a copy of ProgeCAD 2008 or earlier OR autocad ANY version and run my LISP. I'm not sure how you can say it has always sorted in order of creation???

"Selection" sets were and should be sorted in the order of SELECTION.

ProgeCAD themselves admitted there is an issue.

Regards

#1788 by LJL
Wed Jul 04, 2012 11:36 pm
I do appreciate your modified code. Many thanks.

Regards

#1790 by caddit
Thu Jul 05, 2012 5:03 am
Yes its an issue, but no it was not supported in a previous version (may have worked by accident though).


OK, not so sure about 2008 but that's REALLY old and A LOT has changed in progeCAD since that time, and 2008 really isn't supported much anymore since it won't work on anything newer than XP.

Selection set order is a big issue since it is controlled a bit deeper in the code, since much of this is being completely re-written in the next version we might see more of what you want.

#1791 by LJL
Mon Jul 09, 2012 1:12 am
Not support? Maybe not specifically stated in Progecad documentation... But it worked... and it worked the way it is meant to by storing selection sets in order of selection, it had to be coded this way, it can't work by accident. It worked the same as it does in ALL versions of Autocad including 2013.

I have ProgeCAD '08 running on Vista as we speak.

I realise it's a deep issue that may be looked at in the re-writing of the code. But they had to have modified it in the 2010 release somehow for it to change the way it was working. I'm sure if we go back to when it was Intellicad we will see it supported in that documentation, and as Progecad was and is based off that code base my assumption is that it was supported indirectly.

Anyway, we will see what happens.. your work around works so in the sense I am happy.