numskull Posted July 24, 2008 Posted July 24, 2008 Hi all, A pleasant ang wonderful day to you out there..This is my first time to post a thread here and I'm hoping I could make friends.. I'm really not good in making programs. I saw a program which is related to what I wanted to know.. I added something in it then attached it here and It's really really out of shape. My motive is to create automatic gridline only by inputing the distances and separate it by comma. when you pick a point on the screen, it will automatically draws grid with diffrent distance. I am very hopeful that any of you autolisp experts are willing to help me solve this program. Thanks in advance, numskull autogrid.LSP Quote
fixo Posted July 24, 2008 Posted July 24, 2008 Try this slightly changed lisp Hth ;; autogrid.lsp ;; local defuns ;; by VovKa (defun sumlist (lst / ) (if lst (append (sumlist (reverse (cdr (reverse lst)))) (list (apply '+ lst)))) ) ;; by gile (defun str->lst (txtstr delim / pos) (if (setq pos (vl-string-search delim txtstr)) (cons (substr txtstr 1 pos) (str->lst (substr txtstr (+ (strlen delim) pos 1)) delim) ) (list txtstr) ) ) ;;; main part ;; (defun c:gd (/ a data dist_list e osm pt1 pt2 pt_next) (setq osm (getvar "osmode")) (setq data (getstring "Enter grid lengths on X:")) (setq dist_list (str->lst data ",")) (setq dist_list (mapcar 'atof dist_list)) (setq dist_list (sumlist dist_list)) (setq pt1 (getpoint "\nInsertion Point: ")) (setq a (getangle pt1 "\nSpecify direction: ")) (setvar "OSMODE" 0) (setq pt2 (polar pt1 (+ a (/ pi 2)) 1000.)) (prompt "\nOffseting line ... please wait.") (command "line" pt1 pt2 "") (setq e (entlast)) (repeat (length dist_list) (setq pt_next (polar pt1 a (car dist_list))) (command "copy" e "" pt1 pt_next) (setq pt1 pt_next) (setq dist_list (cdr dist_list)) ) (prompt "\ndone.") (setvar "cmdecho" 1) (setvar "osmode" osm) (princ) ) ~'J'~ Quote
numskull Posted July 24, 2008 Author Posted July 24, 2008 hey fixo, it works perfect.. Its really what I want. Thanks a million. I hope you could also answer my other question next time. Quote
fixo Posted July 24, 2008 Posted July 24, 2008 hey fixo, it works perfect.. Its really what I want. Thanks a million. I hope you could also answer my other question next time. Glad to help and welcome on board Feel free to ask what you need - there are too much guys that will help you include me, of course Right now I have started on my own project though... ~'J'~ Quote
numskull Posted July 29, 2008 Author Posted July 29, 2008 Thanks for welcoming me.. I appreciate it so much.. I posted another thread regarding my inquiry that you've answered recently.In case you haven't read it, I have a few questions I'd like to know.I hope I'm not bothering you. I revised some part of your program and added a dialog box.I attached it here also for your info.. I know I'm asking too much but I hope you understand. Thank you fixo.. Autogrid.LSP grid.txt Quote
fixo Posted July 29, 2008 Posted July 29, 2008 Sorry I have not have enough time to help you with explanations Try this one instead, see comments inside the listing of code DCL file is the same you used ~'J'~ Autogrid_1.zip Quote
numskull Posted July 30, 2008 Author Posted July 30, 2008 your so good fixo.. you've done it exactly what i needed. It doesn't matter if you didn't explain it. I know you're doin also something very important so I understand. Your program explain it well. Thanks also for the tips inside my lisp. There are two more things though. I still don't know how to "mapcar" the grid name inside the circle and rectangle and also how to add up the dist_list value so that there will be no more "ox" and "oy" variable. Is it the same procedure as what have you done? If it's not much to you, can you help me with it also? no need to rush, I can wait even if it takes you days do it. How can i make it up to you? I owe u big time.. Thanks fixo... Quote
fixo Posted July 30, 2008 Posted July 30, 2008 Here is edited version, I have added the numbering only Sorry, no more time to help you now I stand crazy busy with my own project for my client Hth ~'J'~ Autogrid_1.zip Quote
numskull Posted July 30, 2008 Author Posted July 30, 2008 Thanks fixo.. I really appreciate all your help.. Sorry if I bother you too much.. Again, thank you.. Quote
fixo Posted July 30, 2008 Posted July 30, 2008 Thanks fixo.. I really appreciate all your help.. Sorry if I bother you too much.. Again, thank you.. No worries, please Glad if this will save your time Cheers ~'J'~ Quote
loody020 Posted October 11, 2015 Posted October 11, 2015 i have this problem http://prntscr.com/8q93ge Please help me solve the problem... Quote
satishrajdev Posted October 12, 2015 Posted October 12, 2015 Download grid.txt file and keep it on drive by renaming grid.dcl and add support path of that directory in Options->files->support file and search path e.g. D:\satish\grid.dcl add support path D:\satish and run the lisp again... Quote
loody020 Posted October 12, 2015 Posted October 12, 2015 thanks a lot...but...i am searching for gridline like i am civil engineer and i need something like this one...do U know link ? 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.