CamBam

Resources => Scripts and Plugins => Topic started by: dh42 on April 12, 2015, 21:52:13 pm

Title: Numeric Polyline Script
Post by: dh42 on April 12, 2015, 21:52:13 pm
Hello,

This afternoon I works on a script designed to draw line with a given length and angle.

run the script then draw a rubber line close to the size and angle you want ; the first point will be fixed.

enter the new values for length and angle in the box (or hit enter/OK if no change for the value.

the cancel button in the window, the ESC key or the MMB are used to terminate/cancel the drawing (the function auto repeat)

I'm working to convert it to a plugin soon.

Code: [Select]
 ' New CamBam VBScript
  ' sized lines - dh42 2015


    Dim abort As Boolean, finished As Boolean, redo As Boolean
    Dim mPoint As Point3F()

    '*******************************************************************************************

    Sub main()

        redo = True

        Dim lgt As Double, ang As Double'lenght, angle
        Dim p As Polyline
dim rep as string 'reply of the inputbox -> "" = cancel
        

        Do While redo = True  'repeat the command until ESC or MMB is pressed

            abort = False
            finished = False

            RuberLine()'use MeasureEditMode to draw a line

            If finished = False Then Exit Do 'aborted by ESC before 'finished' become true

            ' test if 2 identical points = line of null lenght
            If mPoint(0).Equals(mPoint(1)) Then Exit Do

            ' add the polyline to the drawing
            p = AddPoly(mPoint(0), mPoint(1))

            ' display the datas and get the new values

'lenght
            rep = InputBox("Lenght = " & LineLenght(p), "Lenght", Format(LineLenght(p), "0.00#"))
if rep ="" then Exit Do 'canceled with the msgbox button
            lgt = Val(rep)
if lgt = 0 then Exit Do ' new lenght = 0 -> cancel

'angle
            rep = InputBox("Angle = " & LineAngle(p), "Angle", Format(LineAngle(p), "0.00#"))
if rep ="" then Exit Do 'canceled with the msgbox button
            ang = Val(rep)


            'modify the polyline with new lenght and angle
            RedoPoly(p, lgt, ang)
                        
        Loop

    End Sub

    '*******************************************************************************************

    Sub point_clicked(ByVal sender As Object, ByVal e As EventArgs)

        mPoint = sender.returnvalue
        abort = True
        finished = True

    End Sub

    '*******************************************************************************************

    Sub point_clicked_clr(ByVal sender As Object, ByVal e As EventArgs)

        abort = True
        redo = False

    End Sub

    '*******************************************************************************************

    Function LineLenght(p As Polyline) As Double

        'find the distance between the 2 points (2D on XY axis)

        Dim v As Vector2F

        v = New Vector2F(p.FirstPoint, p.LastPoint)

        Return v.Length

    End Function

    '*******************************************************************************************

    Function LineAngle(p As Polyline) As Double

        'find the angle between the 2 points (2D on XY axis)

        Dim v As Vector2F

        v = New Vector2F(p.FirstPoint, p.LastPoint)

        Return (v.Angle / math.Pi) * 180

    End Function

    '*******************************************************************************************

    Sub RedoPoly(poly As Polyline, l As Double, a As Double)

        ' change the polyline lenght, according to the user request
        'l = lenght    a = angle (°)

        ' the news end points ; p1 don't change, it stay the firts point of the polyline at the same location

        Dim p1 As Point3F = New Point3F, p2 As Point3F = New Point3F

        p1 = poly.FirstPoint'catch the firts point of the polyline

        'calculate new lenght

        Dim newlx As Double
        Dim newly As Double

        'convert to radians
        a = DegToRad(a)

        'x lenght
        newlx = l * Math.Cos(a)

        'y lenght
        newly = l * Math.Sin(a)

        'new coord for p2
        p2.X = p1.X + newlx
        p2.Y = p1.Y + newly

        
        'create and add the new polyline
        AddPoly(p1, p2)

'and remove the old polyline (in this order because if not, after the line is created, the snap point
' to the last created line is not working until a new line is created, or removed ..)
'
        CamBamUI.MainUI.ActiveView.CADFile.RemovePrimitive(poly)

    End Sub

    '*******************************************************************************************

    Function DegToRad(angle As Double) As Double
        'convert degré to radians
        Return angle * Math.PI / 180
    End Function

    '*******************************************************************************************

    Function AddPoly(p1 As Point3F, p2 As Point3F) As Polyline

        Dim poly As Polyline = New Polyline

        poly.Add(p1)
        poly.Add(p2)

        'display the polyline
        CamBamUI.MainUI.ActiveView.CADFile.Add(poly)
        CamBamUI.MainUI.ActiveView.RefreshView()

        Return poly

    End Function

    '*******************************************************************************************

    Sub RuberLine()

        Dim edmode As New MeasureEditMode(CamBamUI.MainUI.ActiveView)
        edmode.DefaultValue = vbNull
        edmode.Prompt = "Cliquer du bouton du milieu ou Escape pour terminer"

        AddHandler edmode.OnReturnOK, AddressOf point_clicked
        AddHandler edmode.OnReturnCancel, AddressOf point_clicked_clr

        CamBamUI.MainUI.ActiveView.SetEditMode(edmode)
CamBamUI.MainUI.ActiveView.RepaintEditMode()

        'wait for edit mode finished (or ESC)
        Do While abort = False
            System.Windows.Forms.Application.DoEvents()
        Loop

        RemoveHandler edmode.OnReturnOK, AddressOf point_clicked
        RemoveHandler edmode.OnReturnCancel, AddressOf point_clicked_clr

    End Sub

'*******************************************************************************************

++
David

Edit: plugin version added.
Title: Re: Sized Lines Script
Post by: dave benson on April 12, 2015, 23:07:05 pm
HI David
Good Idea sometimes I miss the ability to do something like this, In a entry line at the bottom of the screen
like autocad and other cads I've worked with.
type --->   @200 < 90 and you get a line 200 long at 90 deg.
I don't know if its worth exploring but if you pop up a entry box and parse the input you may not need the editmode at all. Just thinking out aloud. ;D
Dave
Title: Re: Sized Lines Script
Post by: Garyhlucas on April 13, 2015, 00:28:21 am
David,
What I would really like to see is direct numeric input of the first point, as well as snapping it. That would be a huge improvement to me.
Title: Re: Sized Lines Script
Post by: klystron on April 13, 2015, 13:49:27 pm
Salut David,
ton script pour dessiner une droite avec sa longueur et un angle , fonctionne bien .
Yves .
Title: Re: Sized Lines Script
Post by: dh42 on April 13, 2015, 13:52:18 pm
Hello,

@Dave: Yes no editmode nedeed with this method, it's an idea ;)

I try in my old autocad,  it seems it don't know this formulation with angle ; I can do something like @ 100,20 that give the coordinates x,y for a point (relative to the last point) or without the @ that give absolutes coordinate.

@Gary, currently I'm not able to mix both ; the measureeditmode that I use need 2 clicked points ; I can't give a point by coordinates Or with mouse …that need a custom edit mode that I can't get working yet L .. but maybe I can do 2 differents tool until I found a way to mix it

++
David
Title: Re: Sized Lines Script
Post by: klystron on April 13, 2015, 14:03:00 pm
Re salut David,
oui si on pouvait lui entrer les coordonnées du départ de la droite ( X... Y ... ) au lieu de la faire avec la souris ?.
cela serait plus précis .
c'est peut-être prévu a la prochaine version ?
si non c'est sympa .
Yves.
Title: Re: Sized Lines Script
Post by: dh42 on April 13, 2015, 18:07:26 pm
Hello,

Quote
David,
What I would really like to see is direct numeric input of the first point, as well as snapping it. That would be a huge improvement to me.

Ah ah, I think I can do that ... numerical or mouse input for each point, abs or incr XY values OR length/angle depending of the syntax

currently the command line interpreter is working as following:

@20.2,10 -> X Y, incremental coords from the last point or 0,0 if first point

20.2,10 -> absolute coords

100<30 -> length / angle starting from the last point or 0,0 if first given point

P -> switch to mouse click to enter the point

Maybe it will be usable soon ...  ;)

++
David
Title: Re: Sized Lines Script
Post by: Bubba on April 13, 2015, 20:06:39 pm
David, it is possible to incorporate the dotted line somewhere(as reference line)? I could use sometimes. Thanks.

Keep on the good work! :D ;D
Title: Re: Sized Lines Script
Post by: dave benson on April 13, 2015, 21:56:00 pm
HI David
Fantastic Looks like you have moved pretty fast.
Look forward to seeing it.
Dave.
Title: Re: Sized Lines Script
Post by: dh42 on April 13, 2015, 22:15:42 pm
Re

Quote
David, it is possible to incorporate the dotted line somewhere(as reference line)? I could use sometimes. Thanks.

With Eddy's Mtext object method or with multiple small lines ?

Quote
Fantastic Looks like you have moved pretty fast.

Ah ah .. internet is brocken all the days up to 22:00/23:00 (here it's 00:40::) ... and I've no job to do currently ... then I can spend time to program  ;D

the pb is that I can't access to the VB doc when internet is broken ..  :'(

++
David
Title: Re: Sized Lines Script
Post by: Bubba on April 13, 2015, 22:21:28 pm
Mtext object method?
*************
What is it, I guess I must have miss it :-[
Title: Re: Sized Lines Script
Post by: dh42 on April 13, 2015, 22:32:52 pm
re

it's like on MSDOS, line are created with a text like ------ or -.-.-.  etc ...

the advantage is that it's an unique object, the limits is that you can't snap on it and it can only be used on straight lines.(and it need also the modified stick fonts installed)

http://www.cambam.co.uk/forum/index.php?topic=4297.msg35371#msg35371

I can create a separate utilities to draw this kind of lines, or maybe to convert existing lines to dashed lines after they as been created as normal polyline .. for me it's more easy to do than mix polylines and Mtext line in the same code ..

++
David
Title: Re: Sized Lines Script
Post by: Garyhlucas on April 14, 2015, 01:00:40 am
David,
Your data entry method is consistent with the way it works in AutoCad, so I like it. (your script, not AutoCad!)
Title: Re: Sized Lines Script
Post by: Bubba on April 14, 2015, 02:07:15 am
it's like on MSDOS, line are created with a text like ------
********************
 That would work! :D
Title: Re: Sized Lines Script
Post by: EddyCurrent on April 14, 2015, 07:32:54 am
re

it's like on MSDOS, line are created with a text like ------ or -.-.-.  etc ...

the advantage is that it's an unique object, the limits is that you can't snap on it and it can only be used on straight lines.(and it need also the modified stick fonts installed)
++
David

I decided those types of lines might look okay but in practice they are of little use.
Title: Re: Sized Lines Script
Post by: dh42 on April 18, 2015, 20:18:12 pm
Hello,

And a new version

 @x;y  = incremental mode
 x;y   = absolute mode
 *     = replace x or y with the last x or y coord used
 l<a   = lenght / angle mode
 M     = switch to mouse clic
 R     = remove last point
 C     = close polyline and exit
other entry terminate the drawing

You can change the SEP constant if you want another separator for XY ... I use ";" because on Europa "," is mostly used for decimal separator ..


I'll translate in plugin when time permit ;)

++
David


Code: [Select]
'*****************************************************************************
'VB script Numerical Lines
'dh42 2015

' @x;y  = incremental mode
' x;y   = absolute mode
' *     = replace x or y with the last x or y coord used
' l<a   = lenght / angle mode
' M     = switch to mouse clic
' R     = remove last point
' C     = close polyline and exit
'other entry terminate the drawing

'***************************************************************************

Dim cmd_string As String
Dim current_pt As Point2F, previous_pt As Point2F
Dim lgt As Double, ang As Double
Dim absolute As Boolean

Dim canceled As Boolean 'canceled by ESC
Dim finished As Boolean
Dim removed As Boolean  'a point as been removed

Dim FirstPoint As Boolean   'Is the first created point ?

Const SEP = ";" 'char used for x y separator

Const XPOS = 100    'msgbox position
Const YPOS = 80


'**************************************************************************

Sub main()

Dim input_info As String    'text for the inputbox
Dim ret As Boolean = True ' function return

absolute = True
previous_pt.X = 0
previous_pt.Y = 0
FirstPoint = True
removed = False

'create a undo point for the active layer
CamBamUI.MainUI.UndoBuffer.AddUndoPoint("NumLine")
CamBamUI.MainUI.UndoBuffer.Add(CamBamUI.MainUI.ActiveView.CADFile.ActiveLayer.Entities)

'a pointlist with an unique point used to show the position on the screen
Dim DisplayPoint As PointList = New PointList
DisplayPoint.add(0, 0, 0)

'add the object to the doc
CamBamUI.MainUI.ActiveView.CADFile.Add(DisplayPoint)

'the polyline to create
Dim poly As Polyline = New Polyline
poly.Closed = False

Do While ret = True
'get command string

'create the text with last position
input_info = "last X = " & previous_pt.X & VbNewline & _
"last Y = " & previous_pt.Y

cmd_string = InputBox(input_info, "Numerical Lines", "", XPOS, YPOS)

' START THE CONVERSION OF THE COMMAND LINE
ret = Str_to_Point(poly)

If ret = True Then   'cmd string OK

UpdatePoint(DisplayPoint)   'update the position of the display point

If FirstPoint = True Then    'first entry ; set a undo point and create the polyline object

poly.Add(current_pt.X, current_pt.Y, 0)   'the first point
CamBamUI.MainUI.ActiveView.CADFile.Add(poly)    'add the polyline object to the doc
FirstPoint = False
Else    'it's not the first point entered
If removed = False Then
UpdatePolyline(poly)
End If
End If

If removed = False Then
'retain the last position
previous_pt.X = current_pt.X
previous_pt.Y = current_pt.Y
Else
removed = False
UpdatePoint(DisplayPoint)
End If

End If

Loop

'remove the diplay point object
CamBamUI.MainUI.ActiveView.CADFile.RemovePrimitive(DisplayPoint)

'remove the polyline if it contain no segment
if poly.Points.Count < 2 then
CamBamUI.MainUI.ActiveView.CADFile.RemovePrimitive(poly)
End If

CamBamUI.MainUI.ActiveView.UpdateViewport()

End Sub

'**************************************************************************

Function Str_to_Point(p As Polyline) As Boolean

' read the command line and extract the datas
' return true if commande is correct, false if not
' return false if string ="" -> end of the job

Dim cmd As String 'a temp string
Dim conv_return As Boolean = False

If cmd_string = "" Then Return False 'exit function, drawing aborted

'remove spaces
cmd = Trim(cmd_string)

If Left(cmd, 1) = "@" Then
absolute = False
cmd = Right(cmd, Len(cmd) - 1)  'remove the @
Else
absolute = True
End If

'mouse click asked (m or M)
If Left(cmd, 1) = "m" Or Left(cmd, 1) = "M" Then
If GetOnePointByMouse() = True Then  'catch a point by mouse
cmd_string = ""
Return True
Else
Return False    'canceled by mouse
End If
End If

'remove last point (r or R)
If Left(cmd, 1) = "r" Or Left(cmd, 1) = "R" Then
RemovePoint(p)
cmd_string = ""
Return True
End If

'close and end(c or C)
If Left(cmd, 1) = "c" Or Left(cmd, 1) = "C" Then
p.Closed = True
p.Update()
cmd_string = ""
Return False
End If


'detect if coordinates or lenght/angle
If InStr(cmd, SEP) <> 0 Then    'coord
conv_return = Convert_to_values(cmd, 1)
If conv_return = True Then
cmd_string = ""
Return True
Else
Return False
End If
Else    'lenght/angle
conv_return = Convert_to_values(cmd, 2)
If conv_return = True Then
cmd_string = ""
Return True
Else
Return False
End If
End If

End Function

'**************************************************************************

Function Convert_to_values(command As String, mode As Integer) As Boolean

Dim s As String 'char scanned
Dim separator As String = ""
Dim coord_string As String = "" 'the coordinate as string
Dim a As Double, b As Double

Dim ct As Integer

Select Case mode
Case 1
separator = SEP 'coordinates
Case 2
separator = "<" 'lenght, angle
End Select

'search for separator char
For ct = 0 To Len(command) - 1
s = command.Chars(ct)

If s <> separator Then
coord_string = coord_string & s
Else    'separator found
If IsNumeric(coord_string) Then
a = Val(coord_string)   'convert to double
Exit For
Else
If coord_string = "*" Then 'use last X absolute position
If absolute = True Then
a = previous_pt.X
Else
a = 0   'in inc mode, * = no change
End If
Exit For
Else
Return False    'bad syntax, not a number or * for a
End If
End If
End If
Next ct

coord_string = ""

'read for b
For ct2 As Integer = ct + 1 To Len(command) - 1
s = command.Chars(ct2)
coord_string = coord_string & s
Next ct2

If IsNumeric(coord_string) Then
b = Val(coord_string)   'convert to double
Else
If coord_string = "*" Then 'use last Y absolute position
If absolute = True Then
b = previous_pt.Y
Else
b = 0   'in inc mode, * = no change
End If
Else
Return False    'bad syntax, not a number for b
End If
End If

' terminate ok
' calcultae the new point
Select Case mode
Case 1  'x;y mode

If absolute = True Then 'absolute value
current_pt.X = a
current_pt.Y = b
Else                    'incremental
current_pt.X = a + previous_pt.X
current_pt.Y = b + previous_pt.Y
End If

Case 2  'len<ang mode
lgt = a
ang = b

PointFromLenAng()

End Select

Return True

End Function

'**************************************************************************

Sub UpdatePoint(ByRef pl As PointList)

'update display point datas
pl.Points.RemoveAt(0)   'remove the first point in the point list
pl.Points.Add(current_pt.X, current_pt.Y)   'replace with a point with the new values
pl.Update()

CamBamUI.MainUI.ActiveView.RefreshView()

End Sub

'**************************************************************************

Sub UpdatePolyline(ByRef p As Polyline)

'update the polyline
p.Add(current_pt.X, current_pt.Y, 0)
p.Update()

CamBamUI.MainUI.ActiveView.RefreshView()

End Sub

'**************************************************************************

Sub RemovePoint(ByRef p As Polyline)
'remove the last point entered

If p.Points.Count > 0 Then  'if at least one point is in the polyline
p.Points.RemoveAt(p.Points.Count - 1)   'remove the last point
p.Update()

CamBamUI.MainUI.ActiveView.RefreshView()

If p.Points.Count >= 1 Then  'if at least on point remain in the polyline

previous_pt.X = p.Points.Item(p.Points.Count - 1).Point.X
previous_pt.Y = p.Points.Item(p.Points.Count - 1).Point.Y
Else
previous_pt.X = 0
previous_pt.Y = 0

End If

If p.Points.Count = 0 Then
current_pt.X = 0
current_pt.Y = 0
Else
current_pt.X = p.Points.Item(p.Points.Count - 1).Point.X
current_pt.Y = p.Points.Item(p.Points.Count - 1).Point.Y

End If

End If

removed = True

End Sub

'**************************************************************************

Sub PointFromLenAng()

' lgt = lenght    ang = angle (°) double
' previous_pt.X, previous_pt.Y -> the start point

'calculate new point

Dim newlx As Double
Dim newly As Double

'convert to radians
ang = ang * Math.PI / 180 'convert degré to radians

'x lenght
newlx = lgt * Math.Cos(ang)

'y lenght
newly = lgt * Math.Sin(ang)

'new coord for p2
current_pt.X = previous_pt.X + newlx
current_pt.Y = previous_pt.Y + newly

End Sub

'**************************************************************************

Function GetOnePointByMouse() As Boolean

finished = False
canceled = False

Dim edmode As New PointSelectEditMode(CamBamUI.MainUI.ActiveView)
edmode.DefaultValue = vbNull
edmode.Prompt = "Click a point"
AddHandler edmode.OnReturnOK, AddressOf point_clicked
AddHandler edmode.OnReturnCancel, AddressOf point_canceled

CamBamUI.MainUI.ActiveView.SetEditMode(edmode)  'run the point edit mode
CamBamUI.MainUI.ActiveView.RepaintEditMode()

Do While finished = False
'repeat until  the point is clicked
System.Windows.Forms.Application.DoEvents()
Loop

If canceled = False Then
Return True
Else
Return False
End If

End Function

'**************************************************************************

Sub point_clicked(ByVal sender As Object, ByVal e As EventArgs)

Dim ClickedPoint As Point3F
ClickedPoint = sender.ReturnValue

current_pt.X = ClickedPoint.X
current_pt.Y = ClickedPoint.Y
finished = True

End Sub

'**************************************************************************

Sub point_canceled(ByVal sender As Object, ByVal e As EventArgs)

canceled = True
finished = True

End Sub
Title: Re: Sized Lines Script
Post by: klystron on April 18, 2015, 21:54:38 pm
hello David,
je viens de regarder ta dernière version de ton script, je me suis amusé un peu avec, c'est un utilitaire qui est très intéressant, pour la construction .
maintenant il faut avoir l'habitude de s'en servir.
tu es un as en programmation Cambam, bravo.
Yves.
Title: Re: Sized Lines Script
Post by: dh42 on April 18, 2015, 22:05:31 pm
Quote
tu es un as en programmation Cambam, bravo.

Je n'irais pas jusque la .... je bricole diront-nous .. ;D

++
David
Title: Re: Sized Lines Script
Post by: dave benson on April 18, 2015, 22:15:12 pm
Hi David
Well done, this a a very useful script and I will use it.
Dave
Title: Re: Sized Lines Script
Post by: Bubba on April 19, 2015, 00:46:23 am
I decided those types of lines might look okay but in practice they are of little use.
*****************
 I beg to differ..
 In my experience in the shop environment when drawing complex parts in 2D dotted lines a must. I often find need for them doing my 4th axis design work. It let you visualize better rotated part. For me at least is much faster and easier to draw part in 2D vs solid because my skills of doing so are poor. If is difficult to incorporate dotted lines to the script, fine.. I survived without them. But IMHO it would be nice addition. I'm sure some here would find use for them.   
Title: Re: Sized Lines Script
Post by: lloydsp on April 19, 2015, 01:25:13 am
I certainly find any documentation aids to be helpful.  CamBam is STRONG on capabilities, but not among them is proper drawing documentation.  This would be a boon.

Lloyd
Title: Re: Sized Lines Script
Post by: EddyCurrent on April 19, 2015, 10:40:23 am
I decided those types of lines might look okay but in practice they are of little use.
*****************
 I beg to differ..
 In my experience in the shop environment when drawing complex parts in 2D dotted lines a must. I often find need for them doing my 4th axis design work. It let you visualize better rotated part. For me at least is much faster and easier to draw part in 2D vs solid because my skills of doing so are poor. If is difficult to incorporate dotted lines to the script, fine.. I survived without them. But IMHO it would be nice addition. I'm sure some here would find use for them.   

Bubba, I agree with you that dotted construction lines are an excellent aid and I use them myself, but what I meant was, having the lines as 'text' like in the examples I did might not be useful. The main reasons being, they are not accurately placed and they can't be snapped to, or any other operation that polylines can do.
Title: Re: Sized Lines Script
Post by: dh42 on April 19, 2015, 15:25:14 pm
Hello,

Bubba, as I said, I'll add something to do dashed line but not as a part of this plugin. That need a separate tool to be able to:

- dashed any shape (line, circle etc)
- select the dashed object without that you need to select each separate line one by one ... in other words, I need also to add the "group" tool I show on another topic to manage the dashed objects.

bee patient ;) ... first I'll finish the jobs in progress.

++
David
Title: Re: Sized Lines Script
Post by: Bubba on April 19, 2015, 16:20:53 pm
OK, Guys I got it! Thanks.;D
Title: Re: Sized Lines Script
Post by: dh42 on April 19, 2015, 20:08:33 pm
https://www.youtube.com/watch?v=nKHXDNZcsvc

And I find a bug .... if we create a incremental line just after we have removed a point, the new point is in abs mode even if @ is used ... (but not each time .. ???)

++
David
Title: Re: Sized Lines Script
Post by: dh42 on April 19, 2015, 21:09:55 pm
re

bug corrected ; I do the change in the code in the previous message.

in Sub RemovePoint()  

If p.Points.Count > 1Then   'if at least on point remain in the polyline

replaced by

If p.Points.Count >= 1 Then  'if at least on point remain in the polyline

 ::) ::)

++
David
Title: Re: Numeric Polyline Script
Post by: dh42 on April 26, 2015, 16:20:50 pm
Hello,

And the plugin version. It is in the Draw menu.

Now you can use either "," or ";" as separator for x,y

++
David
Title: Re: Numeric Polyline Script
Post by: dh42 on June 17, 2015, 16:52:54 pm
Hello,

An update that remove a potential bug.

http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/Numeric%20Polyline.html

++
David
Title: Re: Numeric Polyline Script
Post by: EddyCurrent on December 04, 2015, 14:04:33 pm
David,

Could you please change the dialogue box to be modeless ?

I think it needs;
promptDialog.ShowDialog()
to be;
promptDialog.Show()

It would be much more useful then by having it always in view.

Thanks.
Title: Re: Numeric Polyline Script
Post by: dh42 on December 04, 2015, 20:37:14 pm
Hello Eddy,

I take a look, but I can't, the PromptDialog don't recognize the Show, only the ShowDialog ... :-\

To do that, I must create my own form to replace the CamBam build in dialog. (the build in VB InputBox() can't be set as non-modal too)


To be exact, the .Show can be used .... BUT in this case .... the Dialog can't return a value !

++
David
Title: Re: Numeric Polyline Script
Post by: EddyCurrent on December 04, 2015, 21:03:26 pm
Maybe it's more work than it's worth then, thanks for taking a look.
Title: Re: Numeric Polyline Script
Post by: dh42 on December 04, 2015, 21:09:14 pm
Maybe it's more work than it's worth then, thanks for taking a look.

But It can be a good thing if we can zoom/pan during the process ... and with a modal form we can't ! .. I'll take a look when time permit ;)

++
David