firavolla Posted June 16, 2010 Share Posted June 16, 2010 (setq myCount nBare) (setq myRadius (/ dBare 2.0)) (setq px (polar pe0 (dtr 315.0) (* myRadius (sqrt 2.0))) ) (setq D (- bGrinda (* aBeton 2)) ) (setq dist (/ (- D dBare) (- nBare 1)) ) (repeat myCount (command "circle" px myRadius "") (setq px (polar px (dtr 0) dist) ) ) This code works ok on Autocad 2004, but on 2008 the drawing isn't ok at all. This lump of code is supposed to draw a number of nBare circles (the number is given by the user from inside a simple dialogue) of diameter dBare, equally distanced from one another and sittuated between 2 points. For this, as you can see, i set up my first point and then in each itteration i draw the associated circle and reset the point. In autocad 2004, the results, as i said, are ok..but in 2008 the circles are drawn nowhere where they are supposed to be. The first circle is ok, but all the others are gathered where the last one should be. Any ideas? I'm kinda' bumping my head on this one for about 2 hours now.. Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 16, 2010 Share Posted June 16, 2010 Are your OSnaps on? (setq myCount nBare) (setq myRadius (/ dBare 2.0)) (setq px (polar pe0 (dtr 315.0) (* myRadius (sqrt 2.0)))) (setq D (- bGrinda (* aBeton 2))) (setq dist (/ (- D dBare) (- nBare 1))) (repeat myCount [color=Red](command "_.circle" "_non" px myRadius "")[/color] (setq px (polar px (dtr 0) dist) ) ) Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 16, 2010 Share Posted June 16, 2010 Replace the circle command call line with the following; should speed things up a bit. (entmake (list '(0 . "CIRCLE") (cons 10 px) (cons 40 myRadius))) Quote Link to comment Share on other sites More sharing options...
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.