Brian,

If you look at the lastest version of the spiral generator
that is what I did.

See below.

Darren Moore



' Protel Client Basic code SpiralGeneratorProtelScript.bas June 19, 2001
'
' Creates spiral track pattern based on numerical parameters
'
' Written by Eric Albach and posted to the
' Protel EDA Forum on June 2001 (see www.techservinc.com)
'
' Based on Qbasic code written by Brian Guralnick and posted to the
' Protel EDA Forum June 2001
'
' InputBox lines added by Paul Hutchinson June 2001
'
' Removed the integers by Brian Guralnick, June 18, 2001
'
' Change to enter all data in one dialog box Darren Moore 20 June 2001
' Now you are required to pick point in the work place for the X,Y
center position Darren Moore 20 June 2001
' Now includes DropDownBox for layer selection Darren Moore 20 June 2001

DIM x0,y0,stp,growth as DOUBLE
DIM p,p0,pi,xc0,xc1,yc0,yc1 as DOUBLE
pi = 3.141592654#

'----------------------------------------------------
' PCB prompt for coordinate example
' Copyright (c) 2001 Considered Solutions
'----------------------------------------------------
' This macro will prompt for a PCB coordinate and
' display the result in a dialog box
' The ExposePCBToMacro server must be installed
' for this macro to run successfully.
'....................................................

  Dim Result As Integer
  Dim ChoosenOK as String
  Dim XString as String
  Dim YString as String
'  Dim XOffsetString as String
'  Dim YOffsetString as String

Dim LayerList$ (35)
LayerList (0) =  "Current"
LayerList (1) =  "TopSignal"
LayerList (2) =  "Mid1"
LayerList (3) =  "Mid2"
LayerList (4) =  "Mid3"
LayerList (5) =  "Mid4"
LayerList (6) =  "Mid5"
LayerList (7) =  "Mid6"
LayerList (8) =  "Mid7"
LayerList (9) =  "Mid8"
LayerList (10) =  "Mid9"
LayerList (11) =  "Mid10"
LayerList (12) =  "Mid11"
LayerList (13) =  "Mid12"
LayerList (14) =  "Mid13"
LayerList (15) =  "Mid14"
LayerList (16) =  "BottomSignal"
LayerList (17) =  "TopOverlay"
LayerList (18) =  "BottomOverlay"
LayerList (19) =  "TopPaste"
LayerList (20) =  "BottomPaste"
LayerList (21) =  "TopSolder"
LayerList (22) =  "BottomSolder"
LayerList (23) =  "Plane1"
LayerList (24) =  "Plane2"
LayerList (25) =  "Plane3"
LayerList (26) =  "Plane4"
LayerList (27) =  "DrillGuide"
LayerList (28) =  "KeepOut"
LayerList (29) =  "Mechanical1"
LayerList (30) =  "Mechanical2"
LayerList (31) =  "Mechanical3"
LayerList (32) =  "Mechanical4"
LayerList (33) =  "DrillDrawing"
LayerList (34) =  "MultiLayer"


    ResetParameters
    AddStringParameter "Prompt", "Choose center of spiral"
    RunProcess "ExposePCBToMacro:PromptUserForCoordinate"
    GetStringParameter "OK", ChoosenOK
    if ChoosenOK = "Yes" then
       GetStringParameter "X", XString
       GetStringParameter "Y", YString
'      GetStringParameter "OffsetX", XOffsetString
'      GetStringParameter "OffsetY", YOffsetString
    end if

Sub Main ()
 ' Define the dialog box.
 Begin Dialog DialogName1 160, 60, 130, 135, "Place Spiral Track"
  Text    5, 10, 55, 12, "X location"
  Textbox 5, 20, 55, 12, .x0
  Text    5, 35, 55, 12, "Y location"
  Textbox 5, 45, 55, 12, .y0
  Text    5, 60, 55, 12, "Spiral spacing"
  Textbox 5, 70, 55, 12, .spacing
  Text    70, 10, 55, 12, "Number of loops"
  Textbox 70, 20, 55, 12, .loops
  Text    70, 35, 55, 12, "Resolution"
  Textbox 70, 45, 55, 12, .res
  Text    70, 60, 55, 12, "Track width"
  Textbox 70, 70, 55, 12, .trackwidth

  Text        5,85,55,12, "Layer"
  DropListBox 5,95,75,62, LayerList$(), .LayerListBox

  PushButton  20, 115, 30, 12, "Cancel", .Cancel
  OKBUTTON    80, 115, 30, 12
 End Dialog

 ' Dimension an object to represent the dialog.
 Dim Dlg1 As DialogName1

'Default inputs
   Dlg1.x0         = XString
   Dlg1.y0         = YString
   Dlg1.spacing    = 20
   Dlg1.loops      = 2
   Dlg1.res        = 5
   Dlg1.trackwidth = 10

 Dialog Dlg1                  ' Display the dialog.

    If Dlg1.Cancel = 1 Then
    Exit Sub
    End If

Dlg1.loops = Dlg1.loops * 2
stp = Dlg1.res / pi / 4
growth = Dlg1.spacing / pi * stp / 2

' ClientBasic uses only integers with For-Next loops
FOR p0 = 0 TO Dlg1.loops * pi / stp + 1
   p = p0 * stp - stp
   xc1 = (COS(p) * Dlg1.spacing)
   yc1 = (SIN(p) * Dlg1.spacing)
   Dlg1.spacing = Dlg1.spacing + growth
   if p0<>0 then
      ResetParameters
      AddStringParameter  "Width", Dlg1.trackwidth
      AddStringParameter  "Location1.X", Dlg1.x0 + xc0
      AddStringParameter  "Location1.Y", Dlg1.y0 + yc0
      AddStringParameter  "Location2.X", Dlg1.x0 + xc1
      AddStringParameter  "Location2.Y", Dlg1.y0 + yc1
'      AddStringParameter  "UserRouted", "False"
      AddStringParameter  "Layer", LayerList (Dlg1.LayerListBox)
      RunProcess          "PCB:PlaceTrack"
   end if
   xc0=xc1
   yc0=yc1
NEXT p0
End Sub

----------------------------------------------------------------

> -----Original Message-----
> From: Brian Guralnick [mailto:[EMAIL PROTECTED]] 
> Sent: Sunday, 12 August 2001 00:24
> To: Protel EDA Forum
> Subject: [PEDA] or [AEDA] How do I make 1 input box with 
> multiple data entries.
> 
> 
> Hi all,
>     I'm just finishing up my super automatic QFP footprint generator.
> 
> I need the user to enter the following:
> ------------------------------------
> Package width.
> Package width +/- tolerance.      "Yes, this footprint 
> generator makes proper use of
> the tolerances."
> Vertical pin count.
> 
> Package height.
> Package height +/- tolerance.
> Horizontal pin count.
> 
> Pin width.
> Pin width +/- tolerance.
> Pin height.
> Pin height +/- tolerance.
> 
> Pin width over-bleed.
> Pin height over-bleed.
> ------------------------------------
> 
>     Instead of having the user enter 1 value inputbox after 
> the next inputbox, is there an easy way to get 1 big input 
> box with all these entries as separate fields with an 'OK' at 
> the end?  How about assign a graphic for visual aid on what 
> the variables are all about?
> 
> ____________
> Brian Guralnick
> 
> 

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* To post a message: mailto:[EMAIL PROTECTED]
*
* To leave this list visit:
* http://www.techservinc.com/protelusers/leave.html
*                      - or email -
* mailto:[EMAIL PROTECTED]?body=leave%20proteledaforum
*
* Contact the list manager:
* mailto:[EMAIL PROTECTED]
*
* Browse or Search previous postings:
* http://www.mail-archive.com/proteledaforum@techservinc.com
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Reply via email to