Visual LISP, AutoLISP and General Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Re: Additional counter for layer dimension
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
lai wrote:hi, recently i notice that the below lisp somehow it show me some error as below :-
Command: acdl
Enter Distance from Leader Line <1.00>:
; error: bad SSGET list
I not sure what happen...sometimes it works find..but sometime not...i try to do testing too..Copy all the entities in the drawing,copy to a new drawing, then run the lisp again and it work fine but yet, sometimes not...Any idea?
I see, my guess is there area objects included in the selection outside of the current tab
so try changing this
(setq ss (ssget "_X"
'((0 . "DIMENSION,LEADER,MULTILEADER")
(8 . "~Dimension"))))
to this
(setq ss (ssget "_X"
(list '(0 . "DIMENSION,LEADER,MULTILEADER")
'(8 . "~Dimension")(cons 410 (getvar 'Ctab)))))
That will avoid selecting the objects not on the current viewport
Also you may need to add this
(setvar 'Osmode 0) to avoid snapping ot objects while inside (ssget "_C")
Remember this lisp code were writen wihtout r error trapping subs.
HTH
Re: Additional counter for layer dimension
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi pbejse,
Thanks for the feedback..Anyway, i just give it a try as what you given,but still got the error..I have attach along the sample drawing for you to test and my newly modify lisp according to your advise.
Re: Additional counter for layer dimension
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
lai wrote:Hi pbejse,
Thanks for the feedback..Anyway, i just give it a try as what you given,but still got the error..I have attach along the sample drawing for you to test and my newly modify lisp according to your advise.
There lies the problem.... ![]()
'((0 . "MTEXT")(8."~Dimension"));<---- no space between 8."
to
'((0 . "MTEXT")(8 . "~Dimension"))
so....
(setq subsel (ssget "_C"
(trans (toler (* tolr -1) (vlax-safearray->list ll)) 0 1)
(trans (toler tolr (vlax-safearray->list ur)) 0 1)
'((0 . "MTEXT")(8 . "~Dimension"))))
and put the osmode outside of the sget
(Defun c:tot (/ toler tolr ss lst i nme var ll ur)
(setq om (getvar 'Osmode))(setvar 'Osmode 0)
.......
......
(princ "\nNone Found:"))
(setvar 'Osmode om)
(princ)
)
HTH
Re: Additional counter for layer dimension
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
hi, thanks for the advise....I have attach here the final lisp for future user ease to get it....
Re: Additional counter for layer dimension
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
lai wrote:hi, thanks for the advise....I have attach here the final lisp for future user ease to get it....
Great.
Cheers Lai


