Jump to content

Recommended Posts

Posted (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?

 

HH.png

Edited by liuhaixin88
  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

  • liuhaixin88

    12

  • Tharwat

    10

  • neophoible

    1

Top Posters In This Topic

Posted Images

Posted

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 .

Posted
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.........

Posted

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 .

Posted
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 ?

Posted

So I would love to see the DCL file with a sample drawing showing all these kinds of sinks .

Posted (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 by neophoible
Added BTW...
Posted
So I would love to see the DCL file with a sample drawing showing all these kinds of sinks .

 

like this:

h.png

 

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

Posted
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.

Posted

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)
)

Posted
Just a start to go with the type M1 .

 

Tharwat, Thanks very much.

Can Vertical restrictions ?

h3.png

Posted
Check this out .

 

 

Ok, when pick up the pt2, I can use "PER" to osnap,

 

In addition, can use "LINE" to draw this ? because……

h4.png

Posted

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)
)

Posted
This ?

 

 

This :

h6.png

h5.png

Posted

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 .

Posted
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

Posted
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 ?

Posted
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

 

h7.jpg

Posted

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))

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...