home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p115 / 10.ddi / GCD4 / UPL / INSCL.UPL < prev    next >
Encoding:
Text File  |  1989-03-06  |  20.9 KB  |  594 lines

  1. --INSCL.UPL
  2. --03/01/89 NCC PRP/PRL fix
  3. ------------------------------------------------------------------------------
  4. -- This UPL program was designed and written by:                            --
  5. -- 4D Graphics, Inc., 1800 NE 44th St., Suite 210, Renton, WA 98056         --
  6. --                                                                          --
  7. -- Do not remove this notice from this file.                                --
  8. ------------------------------------------------------------------------------
  9.  
  10. --This UPL program implements a new GCD command via UPL to insert construction
  11. --lines in more ways than is availiable with the 'INS LIN CLINE' GCD command.
  12. --When installed in the VNP command table it will execute just like any other
  13. --GCD command.
  14.  
  15. $DataSize 2000  --this reduces the memory requirements of UPL, at most
  16.                 --we only use about 1500 bytes for data, the default value
  17.                 --of DataSize is 20000
  18. group
  19.  
  20.     --data used by several procedures
  21.  
  22.     const integer MaxEnt = 400, CR = 13, Abort = 3, Colon = 58
  23.     const string HelpFile = 'INSCL.HLP'
  24.  
  25.     integer EntData(5), CurrentCPL
  26.     real AngVal, DistVal, VwTrans(15)
  27.     coord VwZ @ VwTrans+26
  28.     boolean Horiz=False, Vert=False, Prl=False, Prp=False, Angle=False, \
  29.             Distance=False, Cir=False, Mid=False, Equi=False
  30. end group
  31.  
  32. proc SetupModifiers-----------------------------------------------------------
  33.  
  34.     --This procedure sets up the modifier words.   It is only called once.
  35.  
  36.     DefineModifier( 1,'HORizontal', 'A',Horiz, 0.0)
  37.     DefineModifier( 2,'VERtical',   'A',Vert, 0.0)
  38.     DefineModifier( 3,'PRL',        'A',Prl, 0.0)
  39.     DefineModifier( 4,'PRP',        'A',Prp, 0.0)
  40.     DefineModifier( 5,'MIDway',     'A',Mid, 0.0)
  41.     DefineModifier( 6,'EQUIPrl',    'A',Equi, 0.0)
  42.     DefineModifier( 7,'CIRcle',     'B',Cir, 0.0)
  43.     DefineModifier( 8,'NOCIRcle',   'B',True, 0.0)
  44.     AngVal = 45.0   --default angle for ANGle modifier
  45.     DistVal = 1.0   --default distance for DISTance modifier
  46.     EntData(5) = 9
  47.     DefineModifier(11,'COLor',      'I', False, Real(EntData(5)))
  48.     EntData(4) = 3
  49.     DefineModifier(12,'FONt',       'I', False, Real(EntData(4)))
  50.     EntData(1) = 256
  51.     DefineModifier(13,'LAYer',      'I', False, Real(EntData(1)))
  52.     
  53. end proc----------------------------------------------------------------------
  54.  
  55. proc ModifierProcessor--------------------------------------------------------
  56.     
  57.     --This procedure puts the user in the modifier processor and after the
  58.     --user enters a <CR>, ':' or ^C will return and then the values the
  59.     --user entered are gotten.
  60.  
  61.     boolean Selected
  62.     real R
  63.     string SVal:1
  64.  
  65.     --always reset ANGle and DISTance modifiers to false (unselected)
  66.     
  67.     DefineModifier( 9,'ANGle',      'R',False, AngVal)
  68.     DefineModifier(10,'DISTance',   'R',False, DistVal) 
  69.  
  70.     SetHelp(HelpFile, 1,0,1)    --set up help indexs
  71.     AskModifiers(0)             --get modifier values from user
  72.     return when LastChar = Abort or LastChar = CR
  73.  
  74.     GetModifier( 1, Horiz, R, SVal)
  75.     GetModifier( 2, Vert, R, SVal)
  76.     GetModifier( 3, Prl, R, SVal)
  77.     GetModifier( 4, Prp, R, SVal)
  78.     GetModifier( 5, Mid, R, SVal)
  79.     GetModifier( 6, Equi, R, SVal)
  80.     GetModifier( 7, Cir, R, SVal)
  81.     GetModifier( 8, Selected, R, SVal)
  82.     GetModifier( 9, Angle, AngVal, SVal)
  83.     GetModifier(10, Distance, DistVal, SVal)
  84.     GetModifier(11, Selected, R, SVal); EntData(5) = Integer(R)
  85.     GetModifier(12, Selected, R, SVal); EntData(4) = Integer(R)
  86.     GetModifier(13, Selected, R, SVal); EntData(1) = Integer(R)
  87.     
  88. end proc----------------------------------------------------------------------
  89.  
  90. proc WarnMsg(In String Msg:80)------------------------------------------------
  91.     TextColor(115)      --use warning message color
  92.     print; print Msg    --display message
  93.     TextColor(106)      --return to standard color
  94. end proc----------------------------------------------------------------------
  95.  
  96. func CoordEq(coord C1, C2) return boolean-------------------------------------
  97.  
  98.     --This function determines if 2 coord values are nearly equal
  99.  
  100.     const real Tol = 0.00001 
  101.  
  102.     return abs(C2.X-C1.X) < Tol and \
  103.            abs(C2.Y-C1.Y) < Tol and \
  104.            abs(C2.Z-C1.Z) < Tol
  105.  
  106. end func----------------------------------------------------------------------
  107.  
  108. proc PrpIt(coord End1, End2, Pnt; InOut PrpPnt)-----------------------------
  109.  
  110.     --Pnt lies on the line from End1 to End2 so we have to do the 
  111.     --opposite inverse slope thing to find a prp line
  112.     --NOTE: line endpoints are allready in view space
  113.  
  114.     coord SlopeVec
  115.     
  116.     if (End1.X = End2.X) then
  117.  
  118.         --The prp slope is 0
  119.  
  120.         PrpPnt.X = Pnt.X + 1.0
  121.         PrpPnt.Y = Pnt.Y
  122.         PrpPnt.Z = Pnt.Z
  123.  
  124.     else if (End1.Y = End2.Y) then
  125.  
  126.         --The prp slope is infinite
  127.  
  128.         PrpPnt.X = Pnt.X
  129.         PrpPnt.Y = Pnt.Y + 1.0
  130.         PrpPnt.Z = Pnt.Z
  131.     
  132.     else
  133.  
  134.         --Some non-trivial slope
  135.         -- vector equation is PrpPnt = Pnt + t * SlopeVec
  136.  
  137.         PrpPnt.X = - (End2.Y - End1.Y)
  138.         PrpPnt.Y = End2.X - End1.X
  139.  
  140.         --PrpPnt.Z = End2.Z - End1.Z
  141.  
  142.         PrpPnt.Z = 0.0
  143.  
  144.         SlopeVec = vunit(PrpPnt)
  145.  
  146.         PrpPnt = Pnt + SlopeVec
  147.  
  148.     endif
  149.  
  150. end proc----------------------------------------------------------------------
  151.  
  152. proc PntPrp2(coord End1, End2, Pnt; InOut PrpPnt)-----------------------------
  153.  
  154.     --This procedure fixes an anomoly in the intrinsic PntPrp routine
  155.  
  156.     PntPrp(End1, End2, Pnt, PrpPnt)
  157.  
  158.     if CoordEq(Pnt,PrpPnt) then
  159.         PrpIt(End1, End2, Pnt, PrpPnt)
  160.     endif
  161.  
  162. end proc----------------------------------------------------------------------
  163.  
  164.  
  165. func PrlLine(coord End1, End2, End3, End4) return boolean---------------------
  166.     
  167.     --This function determines if the line End1-End2 is parallel to End3-End4
  168.  
  169.     End1 = vunit(End2-End1); End2 = vunit(End4-End3)
  170.     return CoordEq(End1,End2) or CoordEq(End1,-End2)
  171.  
  172. end func----------------------------------------------------------------------
  173.  
  174. func CoLinear(coord End1, End2, End3, End4) return boolean--------------------
  175.  
  176.     --This function determines if the line End1-End2 is colinear to the
  177.     --line End3-End4
  178.  
  179.     if PrlLine(End1, End2, End3, End4) then
  180.         PntPrp2(End1, End2, End3, End4)
  181.         return vlen(End3, End4) = 0.0
  182.     else
  183.         return false
  184.     endif
  185.  
  186. end func----------------------------------------------------------------------
  187.  
  188. proc InsCLine(in coord LineEnd1, LineEnd2)------------------------------------
  189.     
  190.     --This procedure adds a new construction line to the database
  191.  
  192.     integer NewMib, err
  193.  
  194.     Addent(15, EntData(1), NewMib, err) --entity type 15 is a CLINE
  195.     WSubrecXZ(NewMib, err, MapVM(LineEnd1), MapVM(LineEnd2))
  196.     RpntEnt(NewMib, 1, err)             --show it on the screen
  197.  
  198. end proc----------------------------------------------------------------------
  199.  
  200. proc GetLineEnds(inout integer LinMib; coord End1, End2)----------------------------
  201.  
  202.     --This procedure gets a line or construction line
  203.  
  204.     integer NEnts, IEnd, err
  205.  
  206.     EntMask(0); EntMask(1); EntMask(15) --allow only lines to be picked
  207.     SetHelp(HelpFile, 1,1,1)       --set up getdata help index
  208.     print 'pick a line ',
  209.     GetEnt(1, NEnts, LinMib, IEnd)
  210.     return when LastChar = Abort or LastChar = CR or NEnts <> 1
  211.  
  212.     if LastChar = Colon then
  213.         RpntEnt(LinMib, 1, err)
  214.     endif
  215.  
  216.     RSubRecXZ(LinMib, 1, err, End1, End2)   --get the endpoints
  217.     End1 = MapMV(End1); End2 = MapMV(End2)  --convert them to view space
  218.  
  219. end proc----------------------------------------------------------------------
  220.  
  221. proc MakeCircleCL(coord End1, End2)-------------------------------------------
  222.     
  223.     --This procedure is used to insert construction lines when the CIRcle
  224.     --modifer is selected.  3 parallel lines are inserted, one at the circle
  225.     --origin and 2 tangent to the circle 
  226.     
  227.     integer i, IEnd, err, Ents(MaxEnt), NEnts
  228.     real R, Len1, ArcRad, ArcTrans(15), A1, A2
  229.     coord AOrg @ ArcTrans+38, ArcZ @ ArcTrans+26, Dir, PrpPnt, CLEnd1, CLEnd2 
  230.     boolean warned = false
  231.  
  232.     EntMask(0); EntMask(3)   --allow only arcs to be picked
  233.     
  234.     SetHelp(HelpFile, 1,1,2)      --set up getdata help index
  235.     print 'pick circles ',
  236.     GetEnt(MaxEnt, NEnts, Ents(1), IEnd)    --get circles
  237.     return when LastChar = Abort or NEnts = 0 
  238.     
  239.     loop i = 1 to NEnts
  240.         RSubrecAC(Ents(i), 1, err, ArcTrans(1), ArcRad, A1, A2)
  241.  
  242.         if CoordEq(ArcZ, VwZ) then
  243.             if CurrentCPL = 0 then
  244.                 AOrg = MapMV(AOrg)      --convert origin to view space
  245.             else
  246.                 AOrg = MapMCPL(AOrg)    --convert origin to CPL space
  247.                 End1 = MapMCPL(MapVM(End1)); End2 = MapMCPL(MapVM(End2))
  248.             endif
  249.  
  250.             Len1 = max(vlen([], AOrg), 1.0)
  251.                 
  252.             --the following 'if' block sets up the first CLINE through the
  253.             --circle origin and the Direction to go for the 2 tangent CLINEs
  254.             
  255.             if Angle then
  256.                 CLEnd1 = AOrg
  257.                 R = atan2(End2.Y-End1.Y,End2.X-End1.X)+DegRad(AngVal)
  258.                 CLEnd2.X = CLEnd1.X+Len1*cos(R)
  259.                 CLEnd2.Y = CLEnd1.Y+Len1*sin(R)
  260.                 CLEnd2.Z = CLEnd1.Z
  261.                 Dir = coord(sin(R), -cos(R), 0.0)
  262.             else if Horiz then
  263.                 CLEnd1 = AOrg
  264.                 CLEnd2 = CLEnd1+coord(Len1, 0.0, 0.0)
  265.                 Dir = [0.0,1.0]
  266.             else if Vert then
  267.                 CLEnd1 = AOrg
  268.                 CLEnd2 = CLEnd1+coord(0.0,Len1,0.0)
  269.                 Dir = [1.0,0.0]
  270.             else if Prp then
  271.                 Dir = vunit(End2-End1)
  272.                 PntPrp2(End1, End2, AOrg, CLEnd2)
  273.                 CLEnd1 = AOrg
  274.             else if Prl then
  275.                 PntPrp2(End1, End2, AOrg, PrpPnt)
  276.                 CLEnd1 = AOrg+(End2-End1)
  277.                 CLEnd2 = AOrg
  278.                 Dir = vunit(AOrg-PrpPnt)
  279.             endif
  280.             
  281.             Dir = Dir*coord(ArcRad,ArcRad,0.0)
  282.             if CurrentCPL <> 0 then
  283.                 Dir = MapMV(MapCPLM(Dir))
  284.                 CLEnd1 = MapMV(MapCPLM(CLEnd1))
  285.                 CLEnd2 = MapMV(MapCPLM(CLEnd2))
  286.             endif
  287.  
  288.             InsCLine(CLEnd1, CLEnd2)            --CLINE through the origin
  289.             InsCLine(CLEnd1+Dir, CLEnd2+Dir)    --add first tangent CLINE
  290.             InsCLine(CLEnd1-Dir, CLEnd2-Dir)    --add second tangen CLINE
  291.         else
  292.             if not Warned then
  293.                 if CurrentCPL = 0 then
  294.                     WarnMsg('circle not in plane with the current view')
  295.                 else
  296.                     WarnMsg('circle not in plane with the current CPL')
  297.                 endif
  298.                 Warned = true
  299.             endif
  300.         endif
  301.     end loop
  302.     
  303.     RpntEnt(Ents(1), NEnts, err)    --repaint the hilighted circles picked
  304.     
  305. end proc----------------------------------------------------------------------
  306.  
  307. proc MakeMidCL----------------------------------------------------------------
  308.     
  309.     --This procedure inserts a contruction line such that it bisects to
  310.     --lines or construction lines
  311.  
  312.     const coord OneHalf = [0.5,0.5,0.5]
  313.     integer err, IEnd, Ents(MaxEnt), NEnts
  314.     coord CLEnd1, CLEnd2, End1, End2, MidA1, MidA2, MidB1, MidB2
  315.  
  316.     EntMask(0); EntMask(1); EntMask(15) --allow only lines to be picked
  317.  
  318.     loop
  319.         loop
  320.             SetHelp(HelpFile, 1,1,3)       --set up getdata help index
  321.             print 'pick 2 lines ',
  322.             GetEnt(2, NEnts, Ents(1), IEnd)
  323.             return when LastChar = Abort or LastChar = CR
  324.             exit when NEnts = 2
  325.             if NEnts = 1 then
  326.                 RpntEnt(Ents(1), 1, err)
  327.             endif
  328.             return when LastChar = Colon 
  329.         end loop
  330.         
  331.         RSubRecXZ(Ents(1), 1, err, MidA1, MidA2)    --get the endpoints
  332.         RSubRecXZ(Ents(2), 1, err, MidB1, MidB2)
  333.  
  334.         --check to make sure they are not colinear 
  335.  
  336.         exit when not CoLinear(MidA1, MidA2, MidB1, MidB2)
  337.         WarnMsg('colinear lines picked, try again')
  338.         RpntEnt(Ents(1), NEnts, err)
  339.     end loop
  340.     
  341.     --swap end points around if necassary
  342.  
  343.     if vlen(MidA1,MidB1)+vlen(MidA2,MidB2) > \
  344.        vlen(MidA1, MidB2)+vlen(MidA2,MidB1) then
  345.         End1 = MidB1
  346.         MidB1 = MidB2
  347.         MidB2 = End1
  348.     endif
  349.     
  350.     if PrlLine(MidA1, MidA2, MidB1, MidB2) then
  351.  
  352.         --lines picked were parallel
  353.  
  354.         CLEnd1 = (MidA1+MidB1)*OneHalf
  355.         CLEnd2 = (MidA2+MidB2)*OneHalf
  356.     else
  357.  
  358.         --lines picked were not parallel
  359.  
  360.         LinIntOf(MidA1, MidA2, MidB1, MidB2, End1, End2)
  361.         CLEnd1 = (End1+End2)*OneHalf
  362.         End1 = MidA2-MidA1
  363.         End2 = MidB2-MidB1
  364.  
  365.         --make sure we bisect the smaller angle made by the 2 lines
  366.  
  367.         if vlen(End1,-End2) < vlen(End1,End2) then
  368.             End2 = -End2
  369.         endif
  370.         CLEnd2 = CLEnd1+(End1+End2)
  371.     endif
  372.     
  373.     InsCLine(MapMV(CLEnd1), MapMV(CLEnd2))
  374.  
  375.     RpntEnt(Ents(1), NEnts, err)    --repaint the picked hilighted lines
  376.     
  377. end proc----------------------------------------------------------------------
  378.  
  379. proc MakeEquiDistCL-----------------------------------------------------------
  380.     
  381.     --This procedure is used when the EQUIP or DIST modifiers are selected.
  382.     --It inserts 2 construction lines which are parallel to the lines 
  383.     --selected and a given distance away.  The distance is either determined
  384.     --by the DIST modifier value (which has precedence if selected) or by
  385.     --using the distance between two parallel lines.
  386.  
  387.     integer I, err, IEnd, Ents(MaxEnt), NEnts
  388.     coord End1, End2, PrpPnt, Dir, LineA1, LineA2, LineB1, LineB2
  389.     real R
  390.     
  391.     EntMask(0); EntMask(1); EntMask(15) --allow only lines to be picked
  392.     if not Distance then
  393.  
  394.         --the EQUIP modifier was used, so get to parallel lines to use to
  395.         --setup the DistVal distance
  396.  
  397.         loop
  398.             loop
  399.                 loop
  400.                     SetHelp(HelpFile, 1,1,4)       --set up getdata help index
  401.                     print 'pick 2 parallel lines ',
  402.                     GetEnt(2, NEnts, Ents(1), IEnd)
  403.                     return when LastChar = Abort or LastChar = CR
  404.                     exit when NEnts = 2
  405.                     if NEnts = 1 then
  406.                         RpntEnt(Ents(1), 1, err)
  407.                     endif
  408.                     return when LastChar = Colon 
  409.                 end loop
  410.                 
  411.                 RSubRecXZ(Ents(1), 1, err, LineA1, LineA2)
  412.                 RSubRecXZ(Ents(2), 1, err, LineB1, LineB2)
  413.                 
  414.                 --check to make sure the lines picked were parallel
  415.  
  416.                 exit when PrlLine(LineA1, LineA2, LineB1, LineB2)
  417.                 
  418.                 WarnMsg('lines are not parallel, try again')
  419.                 RpntEnt(Ents(1), NEnts, err)
  420.             end loop
  421.             
  422.             PntPrp2(LineA1, LineA2, LineB1, PrpPnt)
  423.             R = vlen(LineB1,PrpPnt)
  424.             RpntEnt(Ents(1), NEnts, err)
  425.             exit when R > 0.0
  426.             WarnMsg('lines are colinear, try again')
  427.         end loop
  428.         
  429.         DistVal = R
  430.     endif   
  431.     
  432.     --get lines used to put the CLINES and either side of
  433.  
  434.     SetHelp(HelpFile, 1,1,5)       --set up getdata help index
  435.     print 'pick lines ',
  436.     GetEnt(MaxEnt, NEnts, Ents(1), IEnd)
  437.     return when LastChar = Abort or NEnts = 0 
  438.     
  439.     loop i = 1 to NEnts
  440.         RSubRecXZ(Ents(i), 1, err, End1, End2)
  441.         End1 = MapMV(End1); End2 = MapMV(End2)
  442.         Dir = End2-End1
  443.         Dir.Z = 0.0
  444.         Dir = vunit(Dir)
  445.         Dir = coord(Dir.Y*DistVal, -Dir.X*DistVal, 0.0) 
  446.         InsCLine(End1+Dir, End2+Dir)
  447.         InsCLine(End1-Dir, End2-Dir)
  448.     end loop
  449.  
  450.     RpntEnt(Ents(1), NEnts, err)    --repaint the picked hilighted lines
  451.     
  452. end proc----------------------------------------------------------------------
  453.  
  454. proc MakeDigCL(coord End1, End2)----------------------------------------------
  455.     
  456.     --This procedure puts in construction lines which pass through the given
  457.     --digitize points and are oriented as determined by the ANGle, HORIZontal,
  458.     --VERTical, PRP or PRL modifiers.
  459.  
  460.     const integer MaxDig = 400
  461.     integer i, NDig
  462.     coord CLEnd1, CLEnd2, DigPnts(MaxDig)
  463.     real R, Len1
  464.     
  465.     --get locations to put construction lines through
  466.  
  467.     SetHelp(HelpFile, 1,1,6)       --set up getdata help index
  468.     print 'dig ',
  469.     GetDig(MaxDig, 1, NDig, DigPnts(1))
  470.     return when LastChar = Abort
  471.     
  472.     loop i = 1 to NDig
  473.         CLEnd1 = MapMV(DigPnts(i))
  474.         Len1 = vlen([], CLend1)
  475.         if Angle then
  476.             R = atan2(End2.Y-End1.Y,End2.X-End1.X)+DegRad(AngVal)
  477.             CLEnd2.X = CLEnd1.X+Len1*cos(R)
  478.             CLEnd2.Y = CLEnd1.Y+Len1*sin(R)
  479.             CLEnd2.Z = CLEnd1.Z
  480.         else if Horiz then
  481.             CLEnd2 = CLEnd1+MapMV(MapCPLM(coord(Len1,0.0,0.0))-MapCPLM([]))
  482.         else if Vert then
  483.             CLEnd2 = CLEnd1+MapMV(MapCPLM(coord(0.0,Len1,0.0))-MapCPLM([]))
  484.         else if Prp then
  485.             PntPrp2(End1, End2, CLEnd1, CLEnd2)
  486.         else if Prl then
  487.             CLEnd2 = CLEnd1+vunit(End2-End1)*coord(Len1, Len1, Len1)
  488.         endif
  489.  
  490.         InsCLine(CLEnd1, CLEnd2)
  491.     end loop
  492.        
  493. end proc----------------------------------------------------------------------
  494.  
  495. proc MakePntPntCL-------------------------------------------------------------
  496.     
  497.     --This procedure puts in construction lines which pass through the given
  498.     --pairs of digitize points.
  499.  
  500.     const integer MaxDig = 2
  501.     integer i, NDig
  502.     coord CLEnd1, CLEnd2, DigPnts(MaxDig)
  503.  
  504.     --get locations to put construction lines through
  505.  
  506.     loop
  507.         SetHelp(HelpFile, 1,1,7)        --set up getdata help index
  508.         print 'dig ',
  509.         GetDig(MaxDig, 1, NDig, DigPnts(1))
  510.         return when LastChar = Abort or NDig <> 2
  511.         
  512.         CLEnd1 = MapMV(DigPnts(1))
  513.         CLEnd2 = MapMV(DigPnts(2))
  514.         if CoordEq(CLEnd1, CLEnd2) then
  515.             WarnMsg(' coincident points ')
  516.         else
  517.             InsCLine(CLEnd1, CLEnd2)
  518.         endif
  519.         exit when LastChar = Colon or LastChar = CR
  520.     end loop
  521.     
  522. end proc----------------------------------------------------------------------
  523.  
  524. proc Main---------------------------------------------------------------------
  525.     
  526.     --This is the main procedure to process the UPL 'INSert CLINE' command.
  527.  
  528.     integer LinMib, err
  529.     coord End1 = [], End2 = []
  530.     boolean FirstPass = True
  531.  
  532.     SysVarI(12, CurrentCPL)             --get current CPL number 
  533.     if CurrentCPL = 0 then
  534.         GetView(0, VwTrans(1))          --get current view orientation
  535.     else
  536.         GetCPL(CurrentCPL, VwTrans(1))  --get current CPL orientation
  537.     endif
  538.  
  539.     SetupModifiers  --set up the modifer words for this command
  540.  
  541.     EntData(2) = 0  --view of visability for inserted construction lines
  542.     EntData(3) = -1 --construction lines belong to no group when inserted
  543.     
  544.     loop    --loop to get modifiers
  545.         exit when LastChar = Abort or LastChar = CR
  546.         
  547.         if not FirstPass or LastChar <> Colon then
  548.             ModifierProcessor   --get modifer values from the user
  549.             exit all when LastChar = Abort or LastChar = CR
  550.         EndIf
  551.         
  552.         FirstPass = False              --reset FirstPass flag
  553.         
  554.         loop    --loop in getdata
  555.             if Prp or (Prl and (not Distance or Cir)) or Angle then
  556.                 GetLineEnds(LinMib, End1, End2) --get reference line
  557.                 exit all when LastChar = Abort or LastChar = CR
  558.                 exit loop when LastChar = Colon
  559.             endif
  560.  
  561.             if Cir then
  562.                 if Horiz or Vert or Prp or Prl or Angle then
  563.                     MakeCircleCL(End1, End2)
  564.                 else
  565.                     WarnMsg('HORIZ, VERT, PRP, PRL or ANG '+ \
  566.                             'must also be picked with CIR')
  567.                     print ':',
  568.                 endif
  569.             else
  570.                 if Equi or Distance and not Angle then
  571.                     MakeEquiDistCL
  572.                 else if Mid and not Angle then
  573.                     MakeMidCL
  574.                 else if Horiz or Vert or Prp or Prl or Angle then
  575.                     MakeDigCL(End1, End2)
  576.                 else
  577.                     MakePntPntCL
  578.                 endif
  579.             endif     
  580.  
  581.             --repaint reference line entity gotten above
  582.  
  583.             if Prp or Prl or Angle then RpntEnt(LinMib, 1, err); endif
  584.  
  585.             exit all when LastChar = CR or LastChar = Abort     --all done
  586.             exit when LastChar = Colon  --go back to modifier processor
  587.         end loop      
  588.     end loop
  589.  
  590.     SetHelp('',1,1,1)     --restore default help documentation
  591.  
  592. end proc----------------------------------------------------------------------
  593.  
  594.