Welcome to TalkGraphics.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2006
    Location
    Queensland, Australia
    Posts
    7

    Default Measuring a Line

    Hi all
    I'm new to this forum so padon me if this has been covered.
    I need to know how to measure a line that may not be straight.
    To make my self clearer, i know how long it take my laser to travel
    from point A to point B, for instance if it is cutting at 100mm per min
    but how can i find out if the line is straight,
    Sorry this is harder to explain then i thought
    Thanks Pep
    IP

  2. #2
    Join Date
    Dec 2003
    Location
    Lancaster, CA, USA
    Posts
    3,080

    Default Re: Measuring a Line

    Lines are already measured for you in the property bar or on the transform bar (which isn't up by default but you can open it -- I keep mine open always). You can tell if a line is straight by the endpoints. Lines which are straight have nodes on the end but NO edit handles. If there are edit handles, the line has a curve to it. You can straighten a line by clicking on the end points. On one of the edit handles you have an option called "To Line", this makes both node straight line end node.
    Every day's a new day, "draw" on what you've learned.

    Sally M. Bode
    IP

  3. #3
    Join Date
    Dec 2006
    Location
    Queensland, Australia
    Posts
    7

    Default Re: Measuring a Line

    Thanks for the reply
    I understand what your saying, but the measurement given is as a straight line
    i need to know the complete length including cuves.
    eg 1 foot of rope curved or straight is 1 foot of rope or on a street map the road could be 1 mile as the bird flies or 10 mile with cuves.
    Wat i need to work out is the full cutting path of a line
    Thanks Pep
    IP

  4. #4

    Default Re: Measuring a Line

    I seem to remember Peter Clifton has a script that measures the length of a line, straight or curved. Anybody has the link for that?
    OK, did the search myself. Here's Mr. Clifton's site:
    http://www.clifton89.freeserve.co.uk/
    You want the Curve Length Calculator.
    Last edited by Grafixman; 08 December 2006 at 12:10 AM.
    IP

  5. #5
    Join Date
    Dec 2006
    Location
    Queensland, Australia
    Posts
    7

    Default Re: Measuring a Line

    Quote Originally Posted by Grafixman View Post
    I seem to remember Peter Clifton has a script that measures the length of a line, straight or curved. Anybody has the link for that?
    OK, did the search myself. Here's Mr. Clifton's site:
    http://www.clifton89.freeserve.co.uk/
    You want the Curve Length Calculator.
    Thank you, i think thats wat i need
    IP

  6. #6
    Join Date
    Dec 2006
    Location
    Queensland, Australia
    Posts
    7

    Default Re: Measuring a Line

    Hi Grafixman
    Thanks for the link, i grabed it but i can't get
    it to work, i get an run time error 611
    am i doing something wrong, cause i've never used scripts before
    Thanks Pep
    IP

  7. #7

    Default Re: Measuring a Line

    What version of Draw are you using? Some scripts are version specific and might incompatible. Peter is also a Talkgraphics member, perhaps he could shed some light on this. I'm a complete coding moron, so I wouldn't know what the error means . But the script works on my Corel Draw 11.
    IP

  8. #8
    Join Date
    Aug 2000
    Location
    Gloucestershire, UK
    Posts
    383

    Default Re: Measuring a Line

    Pep

    You can edit the script in notepad and change the line

    coreldraw.automation.xx

    Where xx is the version number of Draw I am guessing that for X3 you enter 13 in place of 11.

    Or you can use the following VBA code which works a little bit better, for instructions on creating a blank VBA project to cut and paste into, see the Draw programming guide for VBA PDF included in the documentation branch of the CorelDRAW Windows Start/Programs menu, around page 16.

    Sub readCurveLength()

    Dim doc As Document
    Dim s As Shape
    Dim drawingScale As Double
    Dim shortUnit As String

    'Get current document settings
    Set doc = ActiveDocument
    'preserve document settings
    doc.SaveSettings
    doc.Unit = doc.Rulers.HUnits

    Select Case doc.Unit
    Case cdrMillimeter
    shortUnit = "mm"
    Case cdrCentimeter
    shortUnit = "cm"
    Case cdrMeter
    shortUnit = "m"
    Case cdrInch
    shortUnit = "in"
    Case cdrFoot
    shortUnit = "ft"
    Case cdrYard
    shortUnit = "yds"
    Case cdrPixel
    shortUnit = "px"
    Case cdrPoint
    shortUnit = "pt"
    End Select

    Set s = ActiveShape
    If Not s Is Nothing Then
    If s.Type = cdrCurveShape Then
    MsgBox (CStr(s.Curve.Length * doc.WorldScale) + _
    " " + shortUnit), vbApplicationModal + vbInformation
    Else
    MsgBox ("Not a curve")
    End If
    End If

    doc.RestoreSettings

    End Sub
    The style challenged Pete'sCrypt
    IP

  9. #9
    Join Date
    Dec 2003
    Location
    Lancaster, CA, USA
    Posts
    3,080

    Default Re: Measuring a Line

    Excellent post, thanks Peter.
    Every day's a new day, "draw" on what you've learned.

    Sally M. Bode
    IP

  10. #10
    Join Date
    Dec 2006
    Location
    Queensland, Australia
    Posts
    7

    Default Re: Measuring a Line

    Thanks Peter
    I changed the text to 13 and that's worked great
    That's exactly what i needed
    I've never worked with VBA so the rest of your info is a bit lost to me
    even after reading the PDF

    Once again thank you
    Pep
    IP

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •