MSasu Posted February 13, 2014 Posted February 13, 2014 I tried to make it work with radio_button in DCL, but I didn't understand how to restore previous selection. You may retain user's selection into a global variable (as rule prefix/suffix it with "*" - i.e. *lastUsedMode*) and at next call use SET_TILE function to pre-select the corresponding radio-button. By the way, please don't quote the previous message; is clear to what you were reffering to and it would just overload the page. Thank you! Quote
lucas3 Posted February 13, 2014 Author Posted February 13, 2014 Yes, I did. That's what I'm gonna work on this weekend. Regards I hope you help me Create a new layer and create a new text style, use this new style dim and put this dim in that new layer. new layer name:dim ,color:index color 3,linetype: Continuous ,lineweight: 0.18 new text style name :ggg, SHX font :gbeitc.shx ,Big font:gbcbig.shx Regards Quote
MSasu Posted February 13, 2014 Posted February 13, 2014 Lucas3, a more effective solution will be to add the said text style to your template (along other features that you know that were required in each drawing). Quote
lucas3 Posted February 13, 2014 Author Posted February 13, 2014 Lucas3, a more effective solution will be to add the said text style to your template (along other features that you know that were required in each drawing). Yes,Was such,but dim text style must assign by lisp,when dimension ,must change layer! Quote
Tharwat Posted February 13, 2014 Posted February 13, 2014 Yes,Was such,but dim text style must assign by lisp,when dimension ,must change layer! Was not THIS your thread ? Quote
lucas3 Posted February 13, 2014 Author Posted February 13, 2014 Was not THIS your thread ? Yes ,Thank you Tharwat,I know Create text style,but I don't know how to use it for dimension Quote
Tharwat Posted February 13, 2014 Posted February 13, 2014 Yes ,Thank you Tharwat,I know Create text style,but I don't know how to use it for dimension Explain your aim clearly . Quote
Snownut Posted February 13, 2014 Posted February 13, 2014 (edited) Instead of having to deal with the DCL file placement (or even the file for that matter), place this bit of code as indicated by the comments. The DCL code is built right into the LISP file, makes updating and edits very easy, only one file to edit. Also included is the code required for dialog box placement, dialog box will reappear on the screen in the last place you moved it to instead of screen center. ;place this function somewhere within your existing function (defun writeslopedcl ( / des tmp) (setq tmp (vl-filename-mktemp nil nil ".dcl") des (open tmp "w") ) (foreach line '( "SLOPE : dialog {" "label = \"Slope Maker\";" " : boxed_column { label = \"Mode\";" " : column {" " : button { key = \"angle\"; label = \"Angle (Degrees)\"; is_tab_stop = true; is_cancel = false; is_default = true; }" " : button { key = \"ratio\"; label = \"Ratio (1:n)\"; is_tab_stop = true; is_cancel = false; is_default = false; }" " : button { key = \"percent\"; label = \"Percentage\"; is_tab_stop = true; is_cancel = false; is_default = false; }" " : button { key = \"all\"; label = \"All\"; is_tab_stop = true; is_cancel = false; is_default = false; }" " }" " }" " }" ) (write-line line des) );foreach (not (setq des (close des))) tmp );end of function (setq tmp (writeslopedcl) dcl_id (load_dialog tmp)) ;replace your existing (load_dialog) with these lines (if (not (new_dialog "SLOPE" dcl_id "" (cond ( *screenpoint* ) ( '(-1 -1) )))) (progn (setq dcl_id (unload_dialog dcl_id)) (vl-file-delete tmp) (princ "\n** Dialog could not be Loaded **") (exit) ) );end if (setq *screenpoint* (done_dialog 1)) ; Replace the existing (done_dialog) line with this one (setq dcl_id (unload_dialog dcl_id)) ; Replace the existing (unload_dialog) line with this one Enjoy, Bruce Edited February 13, 2014 by Snownut Quote
Snownut Posted February 13, 2014 Posted February 13, 2014 Vimcruz, On a side note I would not define a "key" in the dcl as an existing CAD function ie; "angle", would be better to prefix it with some other letter/number. Another benefit of placing the dcl in the lisp and using VLIDE to edit the lisp file, all cad functions show up as blue letters, easier to avoid issues as stated above. (will not happen in a DCL defined file) Quote
vimcruz Posted February 13, 2014 Posted February 13, 2014 (edited) I'm fixing and cleaning the LSP file, I got rid of the DCL file as I took MSasu's tips. Now it's more readable. I moved the *error* function inside the Slope function and used global an localized variables. Here's the v1.1.0. ;; -Change Log- ;; ;; > v1.1.0 ;; ;; - Bug fixes ;; ;; - Code cleaned for more human readable ;; ;; - Moved *error* function inside slope function ;; ;; - Got rid of the DCL file ;; ;;-------------------------------------------------;; Known Issues: - Slope Symbol doesn't follow slope inclination EDIT: Last update slope_v2.1.0.lsp slope.lsp slope_v2.1.0.lsp Edited February 17, 2014 by vimcruz Quote
lucas3 Posted February 14, 2014 Author Posted February 14, 2014 I'm fixing and cleaning the LSP file, I got rid of the DCL file as I took MSasu's tips. Now it's more readable. I moved the *error* function inside the Slope function and used global an localized variables. Here's the v1.1.0. ;; -Change Log- ;; ;; > v1.1.0 ;; ;; - Bug fixes ;; ;; - Code cleaned for more human readable ;; ;; - Moved *error* function inside slope function ;; ;; - Got rid of the DCL file ;; ;;-------------------------------------------------;; Known Issues: - Slope Symbol doesn't follow slope inclination Thank you vimcruz ,I don't know Where need to use "angle" "percent" "everything", I think Only need two buttons, "slope" and "taper" Quote
MSasu Posted February 14, 2014 Posted February 14, 2014 Our friend Vimcruz attmpts to develop a general purpose tool, so those options may prove usefull to other. Quote
lucas3 Posted February 14, 2014 Author Posted February 14, 2014 Our friend Vimcruz attmpts to develop a general purpose tool, so those options may prove usefull to other. I understand. Quote
vimcruz Posted February 14, 2014 Posted February 14, 2014 (edited) After 6 hrs. at work (yes, I know) I made some significant changes to the Slope function. Here's the Change Log: ;; -Change Log- ;; ;; > v2.0.0 ;; ;; - So many bug fixes ;; ;; - Slope symbol now follows line inclination ;; ;; - Instead of selecting points, now you just ;; ;; select the entity ;; ;; - Added function VC:GetVertexList to retrieve ;; ;; a list of entity points ;; ;; - Works for LWPOLYLINE and LINE ;; ;; - Minor typo corrections ;; ;;-------------------------------------------------;; Next Features: - Tapper function - Re-code to work with visual lisp I think I should open a thread to keep it update until final release. Is it ok to moderators/admin? EDIT: Last update slope_v2.1.0.lsp slope_v2.0.0.lsp slope_v2.1.0.lsp Edited February 17, 2014 by vimcruz Quote
Snownut Posted February 15, 2014 Posted February 15, 2014 Whats wrong with continuing this thread, no need to open a new thread for the same subject. Quote
vimcruz Posted February 15, 2014 Posted February 15, 2014 That's true, but to keep it organized and have a first post where people can find quickly what they are looking for. It would be easier to them and It would be easier to me as I could manage updates in a single post. But nvm, I'll keep posting here I remember other forums where people open a thread for his own art/codes/designs/whatever. With content only related to what they do. But I don't know if it's "legal" on this forum. Quote
lucas3 Posted February 15, 2014 Author Posted February 15, 2014 Thank you! vimcruz, In addition to thank you don't know what to say. Quote
Snownut Posted February 15, 2014 Posted February 15, 2014 vimcruz, You have the ability to go back and edit any of your old post, you can just use one post and keep updating the links/code so it always has the latest version. Quote
vimcruz Posted February 17, 2014 Posted February 17, 2014 I think this is gonna be the last update, at least until I get new ideas to make this even better. ;; -Change Log- ;; ;; > v2.1.0 ;; ;; - Number of variables reduced ;; ;; - Code cleaned ;; ;; - New feature: preview of the text's position ;; ;;-------------------------------------------------;; Lucas3, for the "taper" function I need more than the formula, I'm trying to understand how it works on real field to do it right. I've been searching for "taper" in google without luck. Need to know if there's something more than just the ratio (1:N). Regards slope_v2.1.0.lsp Quote
lucas3 Posted February 17, 2014 Author Posted February 17, 2014 (edited) I think this is gonna be the last update, at least until I get new ideas to make this even better. ;; -Change Log- ;; ;; > v2.1.0 ;; ;; - Number of variables reduced ;; ;; - Code cleaned ;; ;; - New feature: preview of the text's position ;; ;;-------------------------------------------------;; Lucas3, for the "taper" function I need more than the formula, I'm trying to understand how it works on real field to do it right. I've been searching for "taper" in google without luck. Need to know if there's something more than just the ratio (1:N). Regards vimcruz ,Thanks for your efforts, about taper at #17 slope formula = tgα= H / L taper formula= 2 tgα=(D-d)/ L Tangent function I just query the data, Autocad mechanical dim methods:1. choose datum line ,2.choose line of reference Dimension taper method is more interesting: Must first draw the center line (command:amceninbet),Centerline as the datum line BTW, use Autocad mechanical ,Can specify the starting point of the lead http://docs.autodesk.com/AMECH_PP/2013/CHS/index.html?url=filesACM/GUID-F3886C59-3BC2-4707-93DF-B488645FB1E0.htm,topicNumber=ACMd30e61977 Edited February 17, 2014 by lucas3 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.