JWeyer Posted December 27, 2008 Posted December 27, 2008 (Moved from 2D Drafting by author...) Is the following feasible? Using AutoCAD R14 or 2004, I would like to be able to draw proposed golf hole centerlines, with as many as four points for each hole. "Pt0" would be a "left click" to indicate the "starting point" (back tee) of the proposed hole centerline... "Pt1" would be a "left click" to indicate the first "landing area" (or the "green location" if the proposed hole were a "Par 3")... "Pt2" would be a "left click" to indicate the second "landing area" (or "green location", if this proposed hole were a "Par 4")... "Pt3" would be a "left click" to indicate the final target if this proposed hole were a "Par 5". (No Par 6's)... At the final point, whether it be "Pt1", "Pt2" or "Pt3", a "Flag_Block" would be inserted to indicate a proposed green location. Hopefully, an active text box window, indicating the distance in "yards" and "total yards", would be displayed as the proposed centerline is stretched in the desired direction. When the "Pt1" grip is established, the "yards' would be labeled automactically near the "Pt1" grip. The same for "Pt2" and "Pt3". The "last point" whether it be "Pt1", "Pt2" or "Pt3" would also display the "total yardage" for that particular hole. Text label format may be something like this: Pt1: [yards] and for points 2 & 3: [yards/total yards] Finally, if any current grip points are selected and relocated, "ALL" current hole distances would be automatically updated in real time. Preprogrammed Layer, Linetype, Color, Scale, and Linewidth would also be included in this routine. (See attached dwg.) Is there anything already out there that can be modified to do SOME or all of the above either in R14/R2004? (I currently use R14, but intend to move to R2004 because of Vista compatibility issues.) Thanks... LayoutExample3.dwg Quote
Lee Mac Posted December 27, 2008 Posted December 27, 2008 In reply to your question: "Is this Feasible?", I would say that to reproduce the diagrams as posted in your thread would be possible, as long as the necessary block filepath is provided etc etc. However, to have a textbox that updates real-time is asking a lot, so I think you may have to settle for something not quite to your exact specifications. Quote
CAB Posted December 28, 2008 Posted December 28, 2008 Quite doable. The gathering of user input for points & inserting the Flag block and placing the text with the distances is easy to do with a simple lisp routine. The updating of the text would require the use of reactors. This too is doable but would require a bit more programing than the first lisp. Quote
CAB Posted December 28, 2008 Posted December 28, 2008 Just took a look at your DWG. My observations: Odd that the Flag blocks have a Z value of 840. Any reason for this? The flag is scaled at 0.5. Is the rotation arbitrary? The insert point for the block is mid way up the flag pole. This strikes me as odd too. You draw with Feet as your base drawing unit. You use a pline as the center-line. The line type is set to 300 as the scale. Looks like you used the Donut command to add the plines marking the center-line vertex points. Do you have any LISP experience? Quote
Lee Mac Posted December 28, 2008 Posted December 28, 2008 Blimey CAB, you really took that one to pieces! Using reactors is a good idea, although having ACAD know which grip movements to react on would be a task in itself! As for the other half of the problem, I think it is pretty feasible, but as you say, the problem would be made a lot easier if the basepoint of the flags were located at the endpoints of the plines. Quote
Lee Mac Posted December 28, 2008 Posted December 28, 2008 Here's a starter: ; Golf by Lee McDonnell ~ 28/12/2008 ; Credit to ASMI for Polyline Vertex Code (defun c:golf (/ *error* varLst oldVars) ; --- Error Trap --- (defun *error* (msg) (mapcar 'setvar varLst oldVars) (if (= msg "") (princ "\nFunction Complete.") (princ "\nError or Esc pressed... ") ) ;_ end if (princ) ) ; end of *error* (setq varLst (list "CMDECHO" "CLAYER") oldVars (mapcar 'getvar varLst) ) ; end setq ; --- Error Trap --- (setvar "cmdecho" 0) (mapcar 'makelay '("DESIGN-PROP-CTR-LINES" "DESIGN-PROP-CTR-LINES-POINTS" "DESIGN-PROP-CTR-LINES-FLAGS" "DESIGN-PROP-CTR-LINES-YARDS" ) ) ;_ end mapcar (setvar "clayer" "DESIGN-PROP-CTR-LINES") (prompt "\nConsruct Polyline: ") (command "_pline") (while (> (getvar "cmdactive") 0) (command pause)) (setq pl (entlast)) (command "_pedit" pl "w" "1.0" "") (command "_chprop" pl "" "C" "BYLAYER" "LT" "AG-CENTER" "S" "300" "") (Pointer pl) (*error* "") (princ) ) ;_ end defun (defun Pointer (ent / plvert don) (setq plvert (mapcar 'cdr (vl-remove-if '(lambda (x) (/= 10 (car x))) (entget ent)))) (setvar "clayer" "DESIGN-PROP-CTR-LINES-POINTS") (foreach coord plvert (command "_donut" "0" "20" coord "") (setq don (entlast)) (command "_chprop" don "" "C" "BYLAYER" "") ) ;_ end foreach ) ;_ end defun (defun makelay (x) (if (not (tblsearch "Layer" x)) (command "-layer" "m" x "") (setvar "clayer" x) ) ;_ end if ) ;_ end defun Quote
JWeyer Posted December 28, 2008 Author Posted December 28, 2008 Thanks Lee and others for your help and comments. It works like I want it to. I've attached an updated drawing file which corrects the insertion point of the flag stick. The elev of the flag, though not important, has been set to "0". Flag rotation can be set to "0" for now. I don't know if a routine could be developed to allow for all possible conflicts with "text" and "centerlines". Usally measurements used for golf course design are in feet except for centerlines. It would be very useful for the architect to be able to see the "yards", as he is stretching the proposed centerlines. (Perhaps I'll have to wait until I switch to R2004.) I've also remove the doughnuts for now. I believe that "something" should be used to identify turning pts. but I not sure what at this point. As you may be able to tell, I've had no formal training in CAD nor lisp. Any help or comments are greatly appreciated... Thanks, Jerry P.S. I don't know if the following code would be of any help, but here is something I found and modified to determine "Total Running Yards" for a proposed golf hole. I would like to see this happen and displayed somewhere as the architect is drawing the proposed centerline and the "dist labels" inserted upon each "left" click. +++++++++++++++++++++++++ ;Running Yards Distance Calculator (defun c:RunYards (/ pt1 pt2 pt3 pt4 d1 d2 d3 d4 ty y1 y2 y3) (graphscr) (setvar "CMDECHO" 0) (setq pt1 (getpoint "Pick Tee "))(terpri) (setq pt2 (getpoint "Pick Landing Area " pt1))(terpri) (setq d1 (distance pt1 pt2)) (setq y1 ( / d1 3)) (prompt "1st shot = ")(prompt (rtos y1 2 0))(prompt " Yards, ") (setq pt3 (getpoint "Next Landing Area "pt2 )) (terpri) (setq d2 (distance pt2 pt3)) (setq y2 (/ d2 3)) (setq ty (+ y1 y2)) (prompt "1st Shot = ")(prompt (rtos y1 2 0))(prompt " Yards, ") (prompt "2nd Shot = ")(prompt (rtos y2 2 0))(prompt " Yards, ") (prompt "= ")(prompt (rtos ty 2 0))(prompt " Yards,") (setq pt4 (getpoint " 3rd Shot "pt3 )) (terpri) (setq d3 (distance pt3 pt4)) (setq y3 (/ d3 3)) (setq ty (+ y1 y2 y3)) (prompt "1st Shot = ")(prompt (rtos y1 2 0))(prompt " Yards, ") (prompt "2nd Shot = ")(prompt (rtos y2 2 0))(prompt " Yards, ") (prompt "3rd Shot = ")(prompt (rtos y3 2 0))(prompt " Yards, ") (prompt "= ")(prompt (rtos ty 2 0))(prompt " Total") (princ) ) ++++++++++++++++++++ LayoutExample4.dwg Quote
Lee Mac Posted December 28, 2008 Posted December 28, 2008 I have updated my last routine: see if this helps: ; Golf by Lee McDonnell ~ 28/12/2008 ; Credit to ASMI for Polyline Vertex Code (defun c:golf (/ *error* varLst oldVars pl plvert dislist totyrd anglist ptslist) ; --- Error Trap --- (defun *error* (msg) (mapcar 'setvar varLst oldVars) (if (= msg "") (princ "\nFunction Complete.") (princ "\nError or Esc pressed... ") ) ;_ end if (princ) ) ; end of *error* (setq varLst (list "CMDECHO" "CLAYER") oldVars (mapcar 'getvar varLst) ) ; end setq ; --- Error Trap --- (setvar "cmdecho" 0) (mapcar 'makelay '("DESIGN-PROP-CTR-LINES" "DESIGN-PROP-CTR-LINES-POINTS" "DESIGN-PROP-CTR-LINES-FLAGS" "DESIGN-PROP-CTR-LINES-YARDS" ) ) ;_ end mapcar (setvar "clayer" "DESIGN-PROP-CTR-LINES") (prompt "\nConsruct Polyline: ") (command "_pline") (while (> (getvar "cmdactive") 0) (command pause)) (setq pl (entlast)) (command "_pedit" pl "w" "1.0" "") (command "_chprop" pl "" "C" "BYLAYER" "LT" "AG-CENTER" "S" "300" "") (setq plvert (mapcar 'cdr (vl-remove-if '(lambda (x) (/= 10 (car x))) (entget pl)))) (Pointer plvert) (pdist plvert) (setq totyrd (/ (apply '+ dislist) 3)) (setq dislist (mapcar '(lambda (x) (/ x 3)) dislist)) (pangs plvert) (alert (vl-princ-to-string anglist)) (setq anglist (mapcar '(lambda (x) (+ x (/ pi 2))) anglist)) (setq ptslist (cdr plvert)) (if (= (length anglist) (length ptslist)) (progn (setq xth 0) (foreach x anglist (setq pt (polar (nth xth ptslist) x 125)) (maketext pt (rtos (nth xth dislist) 2 0)) (command "_chprop" (entlast) "" "C" "BYLAYER" "") (setq xth (1+ xth)) ) ;_ end foreach ) ;_ end progn ) ;_ end if (*error* "") (princ) ) ;_ end defun (defun Pointer (entlist / don) (setvar "clayer" "DESIGN-PROP-CTR-LINES-POINTS") (foreach coord entlist (command "_donut" "0" "20" coord "") (setq don (entlast)) (command "_chprop" don "" "C" "BYLAYER" "") ) ;_ end foreach ) ;_ end defun (defun makelay (x) (if (not (tblsearch "Layer" x)) (command "-layer" "m" x "") (setvar "clayer" x) ) ;_ end if ) ;_ end defun (defun pdist (entlist1 / index len dis) (setq index 0 len (length entlist1) ) ;_ end setq (while (< index (1- len)) (setq dis (distance (nth index entlist1) (nth (1+ index) entlist1) ) ;_ end distance dislist (cons dis dislist) index (1+ index) ) ;_ end setq ) ;_ end while (princ) ) ;_ end defun (defun maketext (x y) (entmake (list '(0 . "TEXT") '(8 . "DESIGN-PROP-CTR-LINES-YARDS") (cons 10 x) (cons 40 30.0) (cons 1 y) '(50 . 0.0) '(7 . "STANDARD") '(71 . 0) '(72 . 1) '(73 . 2) (cons 11 x) ) ; end list ) ; end entmake ) ;_ end defun (defun pangs (entlist2 / len1 index1 ang) (setq index1 0 len1 (length entlist2) ) ;_ end setq (while (< index1 (1- len1)) (setq ang (angle (nth index1 entlist2) (nth (1+ index1) entlist2) ) ;_ end distance anglist (cons ang anglist) index1 (1+ index1) ) ;_ end setq ) ;_ end while (princ) ) ;_ end defun Quote
JWeyer Posted December 29, 2008 Author Posted December 29, 2008 Lee, Thanks for your update to your proposed routine... Using your update, the attached file, shows a proposed hole centerline drawn while using your latest revision (New centerline shown in Magenta). I can see no difference in the results. Could it be because I'm using R14 and you are using a more resent version of AutoCAD? I really appreciate your help and interest. Thanks, Jerry LayoutExample5.dwg Quote
CAB Posted December 29, 2008 Posted December 29, 2008 Just tried Lee's routine in ACAD2k & it worked, so there may be something with 14. I see Lee has not added the Flag block Insert yet. But the text is fine in my test. Quote
David Bethel Posted December 29, 2008 Posted December 29, 2008 I don't think any of the ( vl ) functions were available in R14. I think they were introduced in A2K. -David Quote
CAB Posted December 29, 2008 Posted December 29, 2008 Thanks David. Jerry, What happens if you paste this at the command line in R14? (alert (vl-princ-to-string (+ 1 2 3))) Quote
CAB Posted December 29, 2008 Posted December 29, 2008 I did find this: Visual LISP, and briefly sold it as an add-on to AutoCAD 14 released in May 1997. It was incorporated into AutoCAD 2000 released in March 1999, as a replacement for AutoLISP. Quote
Lee Mac Posted December 29, 2008 Posted December 29, 2008 Thanks for your input CAB, I have not as yet included the flag insert, and I am going to alter it slightly to include the total yardage also. Shame about the vl functions not working in 14, maybe someone can work around them? Quote
Lee Mac Posted December 29, 2008 Posted December 29, 2008 An updated version: (But again, using some vl functions... ) ; Golf by Lee McDonnell ~ 28/12/2008 ; Credit to ASMI for Polyline Vertex Code (defun c:golf (/ *error* varLst oldVars pl plvert dislist totyrd anglist ptslist lastxt txtval) ; --- Error Trap --- (defun *error* (msg) (mapcar 'setvar varLst oldVars) (if (= msg "") (princ "\nFunction Complete.") (princ "\nError or Esc pressed... ") ) ;_ end if (princ) ) ; end of *error* (setq varLst (list "CMDECHO" "CLAYER") oldVars (mapcar 'getvar varLst) ) ; end setq ; --- Error Trap --- (or (getenv "GOLF:OFF") (setenv "GOLF:OFF" "125")) (or (getenv "GOLF:TEXT") (setenv "GOLF:TEXT" "30.0")) (or (getenv "GOLF:LTSCALE") (setenv "GOLF:LTSCALE" "300")) (alert (strcat "Type \"GOLFSET\" to Alter Base Variables \nCurrent Settings: \nText Offset: " (getenv "GOLF:OFF") "\nText Height: " (getenv "GOLF:TEXT") "\nLine-Type Scale: " (getenv "GOLF:LTSCALE") ) ;_ end strcat ) ;_ end alert (setvar "cmdecho" 0) (mapcar 'makelay '("DESIGN-PROP-CTR-LINES" "DESIGN-PROP-CTR-LINES-POINTS" "DESIGN-PROP-CTR-LINES-FLAGS" "DESIGN-PROP-CTR-LINES-YARDS" ) ) ;_ end mapcar (setvar "clayer" "DESIGN-PROP-CTR-LINES") (prompt "\nConsruct Polyline: ") (command "_pline") (while (> (getvar "cmdactive") 0) (command pause)) (setq pl (entlast)) (command "_pedit" pl "w" "1.0" "") (command "_chprop" pl "" "C" "BYLAYER" "LT" "AG-CENTER" "S" (getenv "GOLF:LTSCALE") "") (setq plvert (mapcar 'cdr (vl-remove-if '(lambda (x) (/= 10 (car x))) (entget pl)))) (Pointer plvert) (pdist plvert) (setq totyrd (/ (apply '+ dislist) 3)) (setq dislist (mapcar '(lambda (x) (/ x 3)) dislist)) (pangs plvert) (setq anglist (mapcar '(lambda (x) (+ x (/ pi 2))) anglist)) (setq ptslist (cdr plvert)) (if (= (length anglist) (length ptslist)) (progn (setq xth 0) (foreach x anglist (setq pt (polar (nth xth ptslist) x (atof (getenv "GOLF:OFF")))) (maketext pt (rtos (nth xth dislist) 2 0)) (command "_chprop" (entlast) "" "C" "BYLAYER" "") (setq xth (1+ xth)) ) ;_ end foreach ) ;_ end progn ) ;_ end if (setq lastxt (entget (entlast))) (setq txtval (cdr (assoc 1 lastxt))) (setq lastxt (subst (cons 1 (strcat txtval "/" (rtos totyrd 2 0))) (assoc 1 lastxt) lastxt)) (entmod lastxt) (*error* "") (princ) ) ;_ end defun (defun Pointer (entlist / don) (setvar "clayer" "DESIGN-PROP-CTR-LINES-POINTS") (foreach coord entlist (command "_donut" "0" "20" coord "") (setq don (entlast)) (command "_chprop" don "" "C" "BYLAYER" "") ) ;_ end foreach ) ;_ end defun (defun makelay (x) (if (not (tblsearch "Layer" x)) (command "-layer" "m" x "") (setvar "clayer" x) ) ;_ end if ) ;_ end defun (defun pdist (entlist1 / index len dis) (setq index 0 len (length entlist1) ) ;_ end setq (while (< index (1- len)) (setq dis (distance (nth index entlist1) (nth (1+ index) entlist1) ) ;_ end distance dislist (cons dis dislist) index (1+ index) ) ;_ end setq ) ;_ end while (princ) ) ;_ end defun (defun maketext (x y) (entmake (list '(0 . "TEXT") '(8 . "DESIGN-PROP-CTR-LINES-YARDS") (cons 10 x) (cons 40 (atof (getenv "GOLF:TEXT"))) (cons 1 y) '(50 . 0.0) '(7 . "STANDARD") '(71 . 0) '(72 . 1) '(73 . 2) (cons 11 x) ) ; end list ) ; end entmake ) ;_ end defun (defun pangs (entlist2 / len1 index1 ang) (setq index1 0 len1 (length entlist2) ) ;_ end setq (while (< index1 (1- len1)) (setq ang (angle (nth index1 entlist2) (nth (1+ index1) entlist2) ) ;_ end distance anglist (cons ang anglist) index1 (1+ index1) ) ;_ end setq ) ;_ end while (princ) ) ;_ end defun (defun c:golfset (/ goff gtxt glt) (or (getenv "GOLF:OFF") (setenv "GOLF:OFF" "125")) (or (getenv "GOLF:TEXT") (setenv "GOLF:TEXT" "30.0")) (or (getenv "GOLF:LTSCALE") (setenv "GOLF:LTSCALE" "300")) (alert (strcat "Current Settings: \nText Offset: " (getenv "GOLF:OFF") "\nText Size: " (getenv "GOLF:TEXT") "\nLine-Type Scale: " (getenv "GOLF:LTSCALE") ) ;_ end strcat ) ;_ end alert (if (setq goff (getreal (strcat "\nSpecify Text Offset <" (getenv "GOLF:OFF") "> : " ) ;_ end strcat ) ;_ end getreal ) ;_ end setq (setenv "GOLF:OFF" (rtos goff)) ) ;_ end if (if (setq gtxt (getreal (strcat "\nSpecify Text Height <" (getenv "GOLF:TEXT") "> : " ) ;_ end strcat ) ;_ end getreal ) ;_ end setq (setenv "GOLF:TEXT" (rtos gtxt)) ) ;_ end if (if (setq glt (getreal (strcat "\nSpecify Line-Type Scale <" (getenv "GOLF:LTSCALE") "> : " ) ;_ end strcat ) ;_ end getreal ) ;_ end setq (setenv "GOLF:LTSCALE" (rtos glt)) ) ;_ end if (princ "\nBase Variables Set.") (princ) ) ;_ end defun Quote
Lee Mac Posted December 29, 2008 Posted December 29, 2008 Just got to add the flag block, which won't take much. Should I make a dialog box for the user to select the correct block, or use a default filepath? Quote
Lee Mac Posted December 29, 2008 Posted December 29, 2008 Another quick update - sorry for all the posts here guys, Have updated the LISP to irradicate all vl commands. ; Golf by Lee McDonnell ~ 28/12/2008 ; Credit to David Bethel for Polyline Vertex Code (defun c:golf (/ *error* varLst oldVars pl nlist plvert dislist totyrd anglist ptslist lastxt txtval) ; --- Error Trap --- (defun *error* (msg) (mapcar 'setvar varLst oldVars) (if (= msg "") (princ "\nFunction Complete.") (princ "\nError or Esc pressed... ") ) ;_ end if (princ) ) ; end of *error* (setq varLst (list "CMDECHO" "CLAYER") oldVars (mapcar 'getvar varLst) ) ; end setq ; --- Error Trap --- (or (getenv "GOLF:OFF") (setenv "GOLF:OFF" "125")) (or (getenv "GOLF:TEXT") (setenv "GOLF:TEXT" "30.0")) (or (getenv "GOLF:LTSCALE") (setenv "GOLF:LTSCALE" "300")) (alert (strcat "Type \"GOLFSET\" to Alter Base Variables \nCurrent Settings: \nText Offset: " (getenv "GOLF:OFF") "\nText Height: " (getenv "GOLF:TEXT") "\nLine-Type Scale: " (getenv "GOLF:LTSCALE") ) ;_ end strcat ) ;_ end alert (setvar "cmdecho" 0) (mapcar 'makelay '("DESIGN-PROP-CTR-LINES" "DESIGN-PROP-CTR-LINES-POINTS" "DESIGN-PROP-CTR-LINES-FLAGS" "DESIGN-PROP-CTR-LINES-YARDS" ) ) ;_ end mapcar (setvar "clayer" "DESIGN-PROP-CTR-LINES") (prompt "\nConsruct Polyline: ") (command "_pline") (while (> (getvar "cmdactive") 0) (command pause)) (setq pl (entlast)) (command "_pedit" pl "w" "1.0" "") (command "_chprop" pl "" "C" "BYLAYER" "LT" "AG-CENTER" "S" (getenv "GOLF:LTSCALE") "") (setq plvert (massoc 10 (entget pl))) (Pointer plvert) (pdist plvert) (setq totyrd (/ (apply '+ dislist) 3)) (setq dislist (mapcar '(lambda (x) (/ x 3)) dislist)) (pangs plvert) (setq anglist (mapcar '(lambda (x) (+ x (/ pi 2))) anglist)) (setq ptslist (cdr plvert)) (if (= (length anglist) (length ptslist)) (progn (setq xth 0) (foreach x anglist (setq pt (polar (nth xth ptslist) x (atof (getenv "GOLF:OFF")))) (maketext pt (rtos (nth xth dislist) 2 0)) (command "_chprop" (entlast) "" "C" "BYLAYER" "") (setq xth (1+ xth)) ) ;_ end foreach ) ;_ end progn ) ;_ end if (setq lastxt (entget (entlast))) (setq txtval (cdr (assoc 1 lastxt))) (setq lastxt (subst (cons 1 (strcat txtval "/" (rtos totyrd 2 0))) (assoc 1 lastxt) lastxt)) (entmod lastxt) (*error* "") (princ) ) ;_ end defun (defun Pointer (entlist / don) (setvar "clayer" "DESIGN-PROP-CTR-LINES-POINTS") (foreach coord entlist (command "_donut" "0" "20" coord "") (setq don (entlast)) (command "_chprop" don "" "C" "BYLAYER" "") ) ;_ end foreach ) ;_ end defun (defun makelay (x) (if (not (tblsearch "Layer" x)) (command "-layer" "m" x "") (setvar "clayer" x) ) ;_ end if ) ;_ end defun (defun pdist (entlist1 / index len dis) (setq index 0 len (length entlist1) ) ;_ end setq (while (< index (1- len)) (setq dis (distance (nth index entlist1) (nth (1+ index) entlist1) ) ;_ end distance dislist (cons dis dislist) index (1+ index) ) ;_ end setq ) ;_ end while (princ) ) ;_ end defun (defun maketext (x y) (entmake (list '(0 . "TEXT") '(8 . "DESIGN-PROP-CTR-LINES-YARDS") (cons 10 x) (cons 40 (atof (getenv "GOLF:TEXT"))) (cons 1 y) '(50 . 0.0) '(7 . "STANDARD") '(71 . 0) '(72 . 1) '(73 . 2) (cons 11 x) ) ; end list ) ; end entmake ) ;_ end defun (defun pangs (entlist2 / len1 index1 ang) (setq index1 0 len1 (length entlist2) ) ;_ end setq (while (< index1 (1- len1)) (setq ang (angle (nth index1 entlist2) (nth (1+ index1) entlist2) ) ;_ end distance anglist (cons ang anglist) index1 (1+ index1) ) ;_ end setq ) ;_ end while (princ) ) ;_ end defun (defun massoc (key alist) (foreach x alist (if (eq key (car x)) (setq nlist (cons (cdr x) nlist)) ) ;_ end if ) ;_ end foreach (reverse nlist) ) ;_ end defun (defun c:golfset (/ goff gtxt glt) (or (getenv "GOLF:OFF") (setenv "GOLF:OFF" "125")) (or (getenv "GOLF:TEXT") (setenv "GOLF:TEXT" "30.0")) (or (getenv "GOLF:LTSCALE") (setenv "GOLF:LTSCALE" "300")) (alert (strcat "Current Settings: \nText Offset: " (getenv "GOLF:OFF") "\nText Size: " (getenv "GOLF:TEXT") "\nLine-Type Scale: " (getenv "GOLF:LTSCALE") ) ;_ end strcat ) ;_ end alert (if (setq goff (getreal (strcat "\nSpecify Text Offset <" (getenv "GOLF:OFF") "> : " ) ;_ end strcat ) ;_ end getreal ) ;_ end setq (setenv "GOLF:OFF" (rtos goff)) ) ;_ end if (if (setq gtxt (getreal (strcat "\nSpecify Text Height <" (getenv "GOLF:TEXT") "> : " ) ;_ end strcat ) ;_ end getreal ) ;_ end setq (setenv "GOLF:TEXT" (rtos gtxt)) ) ;_ end if (if (setq glt (getreal (strcat "\nSpecify Line-Type Scale <" (getenv "GOLF:LTSCALE") "> : " ) ;_ end strcat ) ;_ end getreal ) ;_ end setq (setenv "GOLF:LTSCALE" (rtos glt)) ) ;_ end if (princ "\nBase Variables Set.") (princ) ) ;_ end defun Quote
JWeyer Posted December 29, 2008 Author Posted December 29, 2008 Dave, Here is the paste result... Sure do appreciate everyone's help... Jer Command: (alert (vl-princ-to-string (+ 1 2 3))) Error or Esc pressed... *Cancel* Command: *Cancel* Quote
JWeyer Posted December 29, 2008 Author Posted December 29, 2008 Lee, WOW! Great work! I really appreciate what you've done. It's getting very close to what I want it to do. The attached file, will show you that the "Yardage" text is being inserted from the green "back" to the tee. Thus, the yardage is reversed. I tried to correct it on my own but wasn't successful. I would suggest "commenting" out the donuts at this time because I don't think that they are going to be needed. As you said, accumulative yardage and flag sticks would be next. I don't have an answer on the flag "pathname" at this time. I'll get back to you later on that. Long term, using R14, do you think it will be possible to automatically update "Yardage text", using VBA reactors when centerline grips are moved? Many thanks to you and others who have contributed. Jerry LayoutExample6.dwg Quote
CAB Posted December 29, 2008 Posted December 29, 2008 Too bad the vl functions don't work. See attached a revised version of Lee's routine. I added the Flag, it must exist in the DWG for this version. Also removed the donuts. I'll review your new DWG. Golf CL Lee.LSP 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.