Jump to content

Create 3 Center Curves for Polylines


Recommended Posts

Posted (edited)
13 hours ago, mhupp said:

Tho that is pretty cool way to set a bunch of variables with lambda

 

 

 

Just for fun, a slight different way to set variables, I like the dotted pair listing to tie in variable name and its short description.

 

Could be expanded as basic lists with the last item being the 'get' function (string, int, distance....) for different types using read and eval [ (list "ard" "Approach Radius" "getDist") ]

 

 

(defun c:setvariables ( / acount ard crd erd aof eof )
  (setq VariablesList (list
      (cons "ard" "Approach Radius")
      (cons "crd" "Center Radius")
      (cons "erd" "End Radius")
      (cons "aof" "Approach Offset")
      (cons "eof" "Tie In Offet")
  )) ; end list, end setq

  (foreach n VariablesList
    (setq MyX (getDist (strcat "\nSet " (cdr n) ": ")))
    (eval (read (strcat "(setq " (car n) " " (vl-princ-to-string MyX) ")" )))
  ) ; end foreach
)

 

 

(defun c:setvariables ( / acount ard crd erd aof eof )
  (setq VariablesList (list
      (list "ard" "Approach Radius" "getdist")
      (list "crd" "Center Radius" "getdist")
      (list "erd" "End Radius" "getdist")
      (list "aof" "Approach Offset" "getdist")
      (list "eof" "Tie In Offet" "getdist")
  )) ; end list, end setq

  (foreach n VariablesList
    (setq MyX ( (eval (read (last n))) (strcat "\nSet " (cadr n) ": ")))
    (eval (read (strcat "(setq " (car n) " " (vl-princ-to-string MyX) ")" )))
    (if (= (last n) "getstring") ; fix for strings
      (eval (read (strcat "(setq " (car n) " \"" (vl-princ-to-string MyX) "\")" )))
    )
  ) ; end foreach
)

 

 

Couple of edits for typos

Edited by Steven P
  • Like 1

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...