textobj string to numeric value

Discussion in 'AutoCAD' started by Lunt, Jul 14, 2004.

  1. Lunt

    Lunt Guest

    I am giving the user the option to either manually enter a distance value (pipeline length), or to select the distance value on the drawing.....I have code the manual side no prob, but the selection side is giving me a headache....I am not even sure I can code this out......here is the code:

    ThisDrawing.Utility.GetEntity DistanceText, ptPicked, "Please select the distance to the deflection point:"
    DistText = DistanceText.TextString

    Is there any way to change this string into its numerical equivalent? Maybe I cant see the forest through the trees as I am a bit of a vba newb....
     
    Lunt, Jul 14, 2004
    #1
  2. Lunt

    Dragnsbld Guest

    I think you want to use ThisDrawing.Utility.GetPoint dblFstPnt, "Please select deflection point: "
    Thisdrawing.Utility.GetPoint dblSecPnt, "Please select the distance from deflection point: "

    Using Getentity will give you the object you select but not the distance. If you still think that it's the best for your intentions then just use: DisText = cDbl(DistnceText.Textstring)
     
    Dragnsbld, Jul 14, 2004
    #2
  3. Lunt

    Lunt Guest

    thank you I figured it out....and that (CDbl) is the way to do it....
     
    Lunt, Jul 14, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.