Sambuddy Posted November 25, 2019 Posted November 25, 2019 What I am trying to accomplish would be two selection types: 1) what the default texts would be + a manual option and 2) where on the dimension the override to happen. I seem not to be able to successfully select one of the options under (initget "(Typ.) (TYpe.) (Plus-minus ±) Manual"): the manual is supposed to be for non default text. Can someone let me know what is wrong with this? This was my result before attempting to add the first option (initget "(Typ.) (TYpe.) (Plus-minus ±) Manual"). Please help! (defun c:dimch1 (/ Rtrn txt ss in vl) (progn (princ "\nSelect Dimension to modify: ") (setq ss (ssget "_:L" '((0 . "DIMENSION")))) ) ; START OF SELECTION FOR ADDING TEXT ON DIMENSIONS (progn (initget "(Typ.) (TYpe.) (Plus-minus ±) Manual") (setq Rtrn (cond ((getkword "\nType [(Typ.)/(TYpe.)/(Plus-minus ±)/Manual] <Manual>: " ) ) ("Manual") ) ) ) ;(if ;(and (setq Manual (/= (setq txt (getstring t "\n Specify the Text string :")) "" ;)) (progn (cond ((= Rtrn "(Typ.)") (setq Txt "(Typ.)")) ((= Rtrn "(TYpe.)") (setq Txt "(Type.)")) ((= Rtrn "(Plus-minus ±)") (setq Txt "± ")) ((= Rtrn "Manual") (setq Txt Txt)) ) ;end 2nd. condition (repeat (setq in (sslength ss)) (setq vl (vlax-ename->vla-object (ssname ss (setq in (1- in))))) (vl-catch-all-apply 'vla-put-TextOverride (list vl txt)) ) ) ; END OF SELECTION FOR ADDING TEXT ON DIMENSIONS (progn (initget "Above Below Prefix Suffix") (setq Rtrn (cond ((getkword "\nType [Above/Below/Prefix/Suffix] <Suffix>: " ) ) ("Suffix") ) ) ) ; end 1st. progn ;) ;end And (progn (cond ;((= Rtrn "Above") (setq Txt (strcat Txt "\\P<>"))) ;((= Rtrn "Below") (setq Txt (strcat "<>\\P" Txt))) ;((= Rtrn "Prefix") (setq Txt (strcat Txt " <>"))) ;((= Rtrn "Suffix") (setq Txt (strcat "<> " Txt))) ((= Rtrn "Above") (setq Txt (strcat "{\\fArial|b1|i0|c0|p34;" Txt "}" "\\P<>"))) ((= Rtrn "Below") (setq Txt (strcat "<>\\P" "{\\fArial|b1|i0|c0|p34;" Txt "}"))) ; replace it with <>\X{\fArial|b0|i0|c0|p34;(Type)} ((= Rtrn "Prefix") (setq Txt (strcat "{\\fArial|b1|i0|c0|p34;" Txt "}" " <>"))) ((= Rtrn "Suffix") (setq Txt (strcat "<> " "{\\fArial|b1|i0|c0|p34;" Txt "}"))) ) ;end 2nd. condition (repeat (setq in (sslength ss)) (setq vl (vlax-ename->vla-object (ssname ss (setq in (1- in))))) (vl-catch-all-apply 'vla-put-TextOverride (list vl txt)) ) ) ;end 2nd. progn ;) ; end if (princ) ) ;End Defun Quote
Sambuddy Posted November 26, 2019 Author Posted November 26, 2019 Could someone tell me what it is that I am missing to make this work please? Quote
Roy_043 Posted November 26, 2019 Posted November 26, 2019 (edited) I think initget and getkword are well documented. What is stopping you from Reading The Manual? Edited November 26, 2019 by Roy_043 Quote
Sambuddy Posted November 26, 2019 Author Posted November 26, 2019 not quite sure. With this second options I have given myself (Typ./TYpe/...) it just will not execute. I just cannot see where I went wrong! Quote
Roy_043 Posted November 26, 2019 Posted November 26, 2019 Can you please stop posting these gifs? they are quite annoying. Quote
Sambuddy Posted November 26, 2019 Author Posted November 26, 2019 I will stop them immediately! NO MORE GIF Quote
Roy_043 Posted November 26, 2019 Posted November 26, 2019 This works in BricsCAD: (initget "(Typ.) (tYpe.) (Plus-minus±) Manual") 1. Keywords should not share caps. So "tYpe" instead of "TYpe". 2. Keywords cannot contain spaces. So "Plus-minus±" instead of "Plus-minus ±". But I would use: (initget "T Y P M") Quote
Sambuddy Posted November 26, 2019 Author Posted November 26, 2019 Thanks I think my problem was the bloody space! I will see what I can do! Thanks Roy. Quote
BIGAL Posted November 27, 2019 Posted November 27, 2019 I just do not use initget look into downloads here. (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (if (= but nil)(setq but 1)) (setq ans (ah:butts but "v" '("Choose " "Typ." "TYpe." "±" " Manual"))) 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.