liuhaixin88 Posted May 14, 2014 Posted May 14, 2014 (edited) Pick up two point, draw a countersink, two kinds , M1 & M2. I hope it can be extended. can modify parameters in code (9,10, 5,5.5 THAT FIGURES ) Can Dynamic drawing? Edited May 15, 2014 by liuhaixin88 Quote
Tharwat Posted May 14, 2014 Posted May 14, 2014 Hi , If the two types are in the same sizes all the time , you can create a block for each shape and that would be easy to modify later on if needed . Quote
liuhaixin88 Posted May 14, 2014 Author Posted May 14, 2014 Hi , If the two types are in the same sizes all the time , you can create a block for each shape and that would be easy to modify later on if needed . Thanks , Tharwat, nice to meet you ! The length of the hole is uncertain,use block is unsatisfactory. I have other ideas,This is a basic, I want extended. The size of the hole is many, so In the late ,I will use DCL, add data......... Quote
Tharwat Posted May 14, 2014 Posted May 14, 2014 Also if only the length of the Sink is vary , you can make them in a Dynamic Block with length parameter for the length only . just an idea . Quote
liuhaixin88 Posted May 14, 2014 Author Posted May 14, 2014 Also if only the length of the Sink is vary , you can make them in a Dynamic Block with length parameter for the length only . just an idea . I also thought of using dynamic block, This need enter the data (eg. Hole diameter, Sink hole diameter, Sink hole depth, etc) , My idea is use DCL, use drop-down box, choose screw, eg: I choose screw size is M5, so Hole diameter=5.5, Sink hole diameter=9, Sink hole depth=5, These parameters are automatically generated. Can you help me to complete the basic ? Quote
Tharwat Posted May 14, 2014 Posted May 14, 2014 So I would love to see the DCL file with a sample drawing showing all these kinds of sinks . Quote
neophoible Posted May 14, 2014 Posted May 14, 2014 (edited) I also thought of using dynamic block, This need enter the data (eg. Hole diameter, Sink hole diameter, Sink hole depth, etc) , My idea is use DCL, use drop-down box, choose screw, eg: I choose screw size is M5, so Hole diameter=5.5, Sink hole diameter=9, Sink hole depth=5, These parameters are automatically generated.The dynamic block idea is a very good one, and would not need more input than the program you are proposing. But you would need to know how to make dynamic blocks. Do you? If you want to go the program route, then you will need to provide the data to the programmer, as Tharwat is asking. Can you make a DCL file? Do you know how to program in AutoLISP? How much of this will you be able to do yourself? BTW, both ways have probably already been done before, though I do not have anything concrete to show. Is it the result or the process that you are after? Edited May 14, 2014 by neophoible Added BTW... Quote
liuhaixin88 Posted May 14, 2014 Author Posted May 14, 2014 So I would love to see the DCL file with a sample drawing showing all these kinds of sinks . like this: Countersink :dialog{ label="Hole Draw"; spacer; :row{ :column{ :image_button{ key = "RM"; aspect_ratio = 1; width = 15; fixed_width = true; color = -2; allow_accept = true; } :image_button{ key = "UN"; aspect_ratio = 1; width = 15; fixed_width = true; color = -2; allow_accept = true; } } :list_box{ key="RV"; value=8; width=20; height=15; allow_accept=true; } } ok_cancel; } This is a *.slb slide file Countersink.zip Quote
liuhaixin88 Posted May 14, 2014 Author Posted May 14, 2014 The dynamic block idea is a very good one, and would not need more input than the program you are proposing. But you would need to know how to make dynamic blocks. Do you? If you want to go the program route, then you will need to provide the data to the programmer, as Tharwat is asking. Can you make a DCL file? Do you know how to program in AutoLISP? How much of this will you be able to do yourself? BTW, both ways have probably already been done before, though I do not have anything concrete to show. Is it the result or the process that you are after? Thank you for your suggestion! I just nee a basic routine ,later , I will work hard to complete it by myself. Quote
Tharwat Posted May 14, 2014 Posted May 14, 2014 Just a start to go with the type M1 . (defun c:Test (/ 1p 2p d ang 3p 4p 5p 6p 7p 8p 9p 10p 11p) (if (and (setq 1p (getpoint "\n Specify first point :")) (setq 2p (getpoint "\n Second point :" 1p)) (if (<= (setq d (distance 1p 2p)) 5.) (progn (alert "Distance between points must be longer than 5.0 units " ) nil ) t ) ) (progn (setq 3p (polar 1p (+ (setq ang (angle 1p 2p)) (* pi 0.5)) 4.5) 4p (polar 3p (+ ang (* pi 1.5)) 9.) 5p (polar 4p ang 5.) 6p (polar 5p (+ ang (* pi 0.5)) 9.) 7p (polar 5p (angle 5p 6p) 1.75) 8p (polar 7p ang (- d 5.)) 9p (polar 8p (angle 5p 6p) 5.5) 10p (polar 9p (+ ang pi) (- d 5.)) ) (command "_.pline" "_non" 3p "_w" 0. 0. "_non" 4p "_non" 5p "_non" 6p "_c") (command "_.pline" "_non" 7p "_non" 8p "_non" 9p "_non" 10p "_c") ) ) (princ) ) Quote
liuhaixin88 Posted May 15, 2014 Author Posted May 15, 2014 Just a start to go with the type M1 . Tharwat, Thanks very much. Can Vertical restrictions ? Quote
liuhaixin88 Posted May 15, 2014 Author Posted May 15, 2014 Check this out . Ok, when pick up the pt2, I can use "PER" to osnap, In addition, can use "LINE" to draw this ? because…… Quote
Tharwat Posted May 15, 2014 Posted May 15, 2014 This ? (defun c:Test (/ 1p 2p _l d ang 3p 4p 5p 6p 7p 8p 9p 10p 11p) ;; Tharwat 15.May.2014 ;; (if (and (setq 1p (getpoint "\n Specify first point :")) (setq 2p (getpoint "\n Second point :" 1p)) (if (<= (setq d (distance 1p 2p)) 5.) (progn (alert "Distance between points must be longer than 5.0 units ") nil) t ) ) (progn (defun _l (j k) (entmake (list '(0 . "LINE") (cons 10 j) (cons 11 k)))) (setq 3p (polar 1p (+ (setq ang (angle 1p 2p)) (* pi 0.5)) 4.5) 4p (polar 3p (+ ang (* pi 1.5)) 9.) 5p (polar 4p ang 5.) 6p (polar 5p (+ ang (* pi 0.5)) 9.) 7p (polar 5p (angle 5p 6p) 1.75) 8p (polar 7p ang (- d 5.)) 9p (polar 8p (angle 5p 6p) 5.5) 10p (polar 9p (+ ang pi) (- d 5.)) ) (mapcar '_l (list 4p 5p 7p 9p 10p 6p) (list 5p 7p 8p 10p 6p 3p)) ) ) (princ) ) Quote
Tharwat Posted May 15, 2014 Posted May 15, 2014 Now you have two different routines that you can play with to get the best result that you are looking forward , so feel free to modify them . Quote
liuhaixin88 Posted May 15, 2014 Author Posted May 15, 2014 Now you have two different routines that you can play with to get the best result that you are looking forward , so feel free to modify them . sorry ,The problem of #15, I can't solve Quote
Tharwat Posted May 15, 2014 Posted May 15, 2014 sorry ,The problem of #15, I can't solve What is that problem ? You want to add one more line as per the highlighted one in your post # 15 ? Quote
liuhaixin88 Posted May 15, 2014 Author Posted May 15, 2014 What is that problem ? You want to add one more line as per the highlighted one in your post # 15 ? Your routines is draw 6 line , I want 5 line Quote
Tharwat Posted May 15, 2014 Posted May 15, 2014 Just replace the following line of codes from the previous routine in post # 14 (mapcar '_l (list 4p 5p 7p 9p 6p) (list 5p 6p 8p 10p 3p)) 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.