What am I doing wrong ?

I wrote a little something to create flanges with just a few questions. The code is simple enough, but the holes on the bolt circle are always arrayed
from a center point which is a hole radius away from the diameter center. Confused ? Good. Here's the code, try it out. It's french, but most of you shouldn't have a problem with that.
And yes, Bride means flange.
Thanx
Dr Fleau
;;; Bride.lsp ;;; Dessine une bride avec quelques questions ;;; Trace les centres des cercles avant de faire un array (DEFUN c:bride (/ out in bc num trou cen cen1 cir1 cir2 cir3) (SETQ out (GETREAL "Donne le diamètre EXTÉRIEUR : ") in (GETREAL "Donne le diamètre INTÉRIEUR :") bc (GETREAL "Donne le diamètre de perçage : ") num (GETINT "Combien de trous : ") trou (GETREAL "Quel diamètre de trou : ") cen (GETPOINT "Point d'insertion : ") ) ;_ end of setq (IF (NOT (AND (TBLSEARCH "layer" "Axe") (TBLSEARCH "layer" "Pièce") ) ;_ END and ) ;_ END not (PROGN (COMMAND "layer" "m" "Axe" "c" "Red" "" "l" "center" "" "") ;_ END COMMAND (COMMAND "layer" "m" "Pièce" "c" "Magenta" "" "l" "continuous" "" "") ;_ END COMMAND ) ;_ END progn ) (SETVAR "OSMODE" 0) (setvar "CLAYER" "Pièce") (COMMAND "_.circle" cen "D" out) (COMMAND "_.circle" cen "D" in) (SETQ cen1 (POLAR cen (/ PI 2) (/ bc 2))) (COMMAND "_.circle" cen1 "D" trou) (setq cir1 (entlast)) (setvar "CLAYER" "AXE") (command "_.line" (polar cen1 (/ pi 2) (/ trou 2)) (polar cen1 (/ pi -2) (/ trou 2)) "") (setq cir2 (entlast)) (command "_.line" (polar cen1 pi (/ trou 2)) (polar cen1 0.0 (/ trou 2)) "") (setq cir3 (entlast)) (setvar "OSMODE" 0) (command "_.regen") (COMMAND "_.array" cir1 cir2 cir3 "" "P" cen num 360 "N") (setvar "CLAYER" "Pièce") (SETVAR "OSMODE" 183) (PRINC) ) ;_ end of defun
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
I posted the following reply a few days ago in the cadforum.ne customization forum
The problem is with how the "array" command works.
Hint: if the objects ARE rotated during an array, the array will b
concentric with other circles
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
True to internet form and protocol, snipped-for-privacy@eeiteam-dot-com.no-spam.invalid (CarlB) said:
-->I posted the following reply a few days ago in the cadforum.net -->customization forum: --> -->The problem is with how the "array" command works. --> -->Hint: if the objects ARE rotated during an array, the array will be -->concentric with other circles.
Thanx. Sorry for posting twice, the news reader at work didn't show your reply. I'm at home right now. I'll give it a shot tomorrow.
Pierre
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Tried it, works fine. I would've liked to keep the center lines vertical, but hey...
Thanx again.
Pete
(CarlB) said:

Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
You're welcome. Maybe you didn't see my other post as I access th site through web browser not news reader
If you want vertical lines, you could make your own array function i
the routine, which copies the initial bolt hole as needed in a pola fashion
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Forgive me if I'm off topic - I looked for CarlB's routine on the customization forum, but for some reason I'm not finding it. Still I am following what you're doing - my comment is :
Standard practice for rotated flange holes is not to have vertical centerlines. They should rotate as well.
This issue is debated in Mechanical Desktop groups as well, as MDTseems to want to retain vertical centerlines, which drives traditional drawing checkers batty.
G Faris
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I don't really care if the lines are rotated or not. My routine was simply to create a punching pattern for the guys in the shop in less time than it would take to do all the steps manually. I just think that, visually, the centerlines are easier to work with, i.e. they jump out more. This being said, thank you for all your replies and I'll add this group is top notch for occasionnal lispers like myself.
Pete
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.