Data to Calculator or other program

Discussion in 'AutoCAD' started by TCEBob, Dec 31, 2004.

  1. TCEBob

    TCEBob Guest

    I like to have Calc2 over in a corner while working pipe slopes, etc. But
    windows Calculator or others would work, too. If I get data off the drawing (by
    getdist or getpoint) how can I place it in the clipboard so it can be inserted
    into the calculator? Can't find it in vlisp but I bet it can be done with
    Vbasic. Or can the Clipboard be opened like a file for input?

    rs
     
    TCEBob, Dec 31, 2004
    #1
  2. TCEBob

    Tom Smith Guest

    Or can the Clipboard be opened like a file for input?

    Yes, in NT at least, there's a Clipbook Viewer application included.

    Way back, I remember a wish-list fantasy item being kicked around -- a
    dedicated Acad calculator where you could denote numbers, areas, distances,
    etc. by picking them from the graphic screen. For instance, pick two
    dimensions to extract their distance info, and mutliply them to get an area,
    or obtain an angle by picking a sloped line, that sort of thing. Still could
    be a good thing if someone could figure out the interface.
     
    Tom Smith, Dec 31, 2004
    #2
  3. TCEBob

    Joe Burke Guest

    Bob,

    DOSLib: (dos_clipboard (rtos <number>)) and paste to calculator.

    Joe Burke
     
    Joe Burke, Dec 31, 2004
    #3
  4. TCEBob

    TCEBob Guest

    Thanks guys. Actually, that on-screen calculator was on my mind. If the whole
    thing -- calculator and interface were written within the Visual Whatever sphere
    then the clipboard wouldn't be needed. But I do like Calc2 and can't see
    replicating it in Vlisp.

    I will give DOSLib a shot.

    rs
     
    TCEBob, Jan 1, 2005
    #4
  5. Copying and pasting (with ^C and^V) from the AutoCAD text screen into the
    Windows Calculator works, if that does what you want.
     
    Kent Cooper, AIA, Jan 4, 2005
    #5
  6. TCEBob

    TCEBob Guest

    I was trying to do it programmatically. Pick a distance or text and place it in
    the clipboard.

    rs
     
    TCEBob, Jan 4, 2005
    #6
  7. Hi, Hang in there. I have a program that I wrote that I have adapted for
    clipboard support. I downloaded the trial of Calc2 and was able to run
    my program to get a distance and then hit paste in Calc2 and it worked.

    Tom Smith mentoned a wish list program and this program may come close,
    no areas though, just distances and angles.

    It may or may not be for your style of working.

    First of all the warnings. It is a very large program due to all of the
    functionality and GUI interface. It uses ObjectDCL so you have to
    install that runtime. It uses DosLib, only for the clipboard, so you
    have to have that also. Works without DosLib if the clipboarad is not
    used. There are many files and it is designed to be run as a Vlx. There
    is no main program which when loaded will load all of the support
    functions. It was written and tested in 2002. I do not know how it will
    react in newer versions as I don't have those for testing.

    There are two main functions and a host of smaller ones that are built
    from the main components. It is designed as an angle and distance GUI
    library that you can use anytime you want a distance or angle in your
    program. The two main programs are examples of using this library.

    First is GD for GetDistance. Works stand alone at the command line to
    check distances or can be called by any Acad function that requests a
    distance.

    Call GD, a dialog appears. Buttons across the top allow picking
    distances by different modes. Pick two points. Pick any object that has
    a length property and the length is returned. Pick two points on any
    object and the length between the points is returned. Quick picks for
    diameter and radius. Works on objects nested in blocks. Any Object means
    lines, plines, circles, arcs, ellipses, elliptical arcs, and open or
    closed splines.

    Has a History which stores the last selected values plus five user saved
    values.

    Uses the current drawing Lunits or can be swithched to decimal. User can
    control the precision of the final output.

    Can keep a running total of selected distances

    Supports Acads calculator. When calculator activated, the user is shown
    a dialog which lists Symbols set to all distances in History and angles
    from companion program, GA, GetAngle. So for example if you save two
    distances, U1 and U2, the expression to average them would be
    "(u1 + U2)/2.0". In other words, you don't type in numbers but use
    defined symbols.

    It is MID aware. You can pick a distance in one drawing and use it in
    another.

    Gonna stop now. There is too much more to explain.

    This a fairly stable and tested program. I've been working on it for a
    couple years on and off. It is alot more complex that it looks. I had to
    write a matrices library to go from World to Entity coordinate system
    (or was it vice versa - anyway the way you didn't used to be able to go)
    to enable some nested block functionality. That took a couple of months.

    I will have the program done in a week or so and will post in Customer
    files.

    Larry
     
    Larry Leuallen, Jan 5, 2005
    #7
  8. TCEBob

    TCEBob Guest

    Wow. Sounds great! I will haunt Customer Files.

    rs
     
    TCEBob, Jan 5, 2005
    #8
  9. TCEBob

    TCEBob Guest

    Outstanding. I will fly it today.

    Thanks,

    rs
     
    TCEBob, Jan 5, 2005
    #9
  10. TCEBob

    TCEBob Guest

    I did, and it works fine. One problem, you can't have it inactive but visible.
    So It would be a bit tedious to crank a number, copy it to clipboard, kill the
    routine and then paste to a text or mtext line. But its ability to grab various
    values is very good.

    Not exactly what I was looking for but so nice I will keep it on hand.

    rs
     
    TCEBob, Jan 5, 2005
    #10
  11. I am posting GetDistance Manual.pdf to customer files today. It
    describes in detail the capabilities of the program. I will post the
    program in a couple of days after I clean a few things up.

    Larry
     
    Larry Leuallen, Jan 5, 2005
    #11
  12. I an posting today the big product description in customer files, the
    GetDistance Manual.pdf. It is large but describes in detail what the
    program and functions do. The main functions are really pretty self
    explanitory in use and you don't really need to study the manual, but
    there are some other very useful functions in there that one might be
    interested in. They are all built from the main engine functions. Me, I
    always liked to read about things in case I missed something.

    DosLib works well. Is very easy and commonly available. Clipboard is the
    only place I used DosLib. If you don't have it, Clipboard does not work
    but the program does not crash and is otherwise functional.


    Thanks for the MS tip, though. I doubt that it would be as easy as the
    couple of hours I spent modifying with DosLib.

    Larry
     
    Larry Leuallen, Jan 5, 2005
    #12
  13. Second reply.

    Forgt to tell you to try the calculator functionality in GetDistance.

    Pick the length that you want or a couple and save them with the
    History. Activate the calculator. Use the symbols for the lengths you
    picked in your calculations. The answer is returned to the program and
    from there to your eyes or supplied directly to an Acad command. No
    pasting or messing around.

    I know nothing about piping and what you are trying to do, what type of
    calculations and so on. But it seems to me that this is a candidate for
    a dedicated function. With the way my program is written, it should
    fairly easy to use it in a dedicated function to get a distance or more
    than one, angles if required, feed the data to Geomcal, get the answer
    and be done. That assumes that the same or very similar calculations are
    always being done.

    If you send me some comprehensive examples of all that you want to do,
    I'll see if I can knock something up.



    Larry
     
    Larry Leuallen, Jan 5, 2005
    #13
  14. TCEBob

    TCEBob Guest

    I'll be glad to supply examples. But, really, my original need was to pick a
    text object and stow the string into the clipboard. The business about picking
    points may be adding more complexity than I had in mind. There's no magic in
    pipes or civil calculating in general; just distance, slope, etc.

    rs
     
    TCEBob, Jan 6, 2005
    #14
  15. Understood. I thought you were picking distances from geometry which is
    what the program I proposed does.

    For getting numbers from text, I knocked up a little function and have
    posted it Customer files. It is called GetTextNumber.zip.

    Hope you get this post and can use the function. Requires DosLib.

    Function: GTN - GetTextNumbers

    Select an entity which contains text and a number(s) that you wish to
    copy to the clipboard. Function tested with Text, Mtext, Dimensions,
    and Qleader. When selecting from a Qleader, select the text portion.

    Functions scans text and retrieves legally formatted numbers contained
    in the text. If there is only one number, the number is placed
    immediately on the clipboard. If there is more than one number, a dialog
    box is displayed containing the numbers in their original format. Select
    one of the numbers and it is placed on the clipboard.

    Numbers are placed on the clipboard in decimal format suitable for use
    with a calculator.



    Larry
     
    Larry Leuallen, Jan 11, 2005
    #15
  16. TCEBob

    krispy Guest

    in VBA::
    Code:
    Dim textObj As DataObject
    Set textObj = New DataObject
    textObj.SetText "put text here"
    textObj.PutInClipboard
    
    or in a LISP hack:
    Code:
    (defun c:clipboardTest()
    (command ".vbastmt"
    "Set textObj = New DataObject"
    ".vbastmt"
    "textObj.SetText \"put text here\""
    ".vbastmt"
    "textObj.PutInClipboard"
    );command
    (princ)
    )
    
     
    krispy, Jan 11, 2005
    #16
  17. TCEBob

    TCEBob Guest

    Thanks, Larry. I have DosLib and will use it if necessary, but it's unwieldy to
    circulate a small lisp routine with a whole library. I'd rather have code if I
    can figure it out. Can't one sneak bits of visual basic into lisp?

    rs
     
    TCEBob, Jan 11, 2005
    #17
  18. TCEBob

    TCEBob Guest

    Ok, PutInClipboard is a routine available in VBA, I take it. I will now read up
    on VBA.

    Thanks

    rs
     
    TCEBob, Jan 11, 2005
    #18
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.