See the top rated post in this thread. Click here

Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Utilitiy to permit entering values in units other than what is set in drawing?

  1. #11
    Member
    Join Date
    2023-07
    Posts
    15
    Login to Give a bone
    0

    Default Re: Utilitiy to permit entering values in units other than what is set in drawing?

    I has been decades since I've created a LISP program, and even then my efforts were quite minimal. But, this utility should be quite simple, and may be a good way to get back into LISP.

    Thinking through the logic of the program,
    1. User would type 'c [c for convert]
    2. The program would take over and at the command line, and prompt the user to enter the value. It would expect the user to enter the distance the same way it would expect if the transparent command were not used. For example, if units were set to inches, and you were entering the 2nd point for a line in mm, you might enter 23mm<45, or 4'3-1/2"<0.
    3. The program would first check what the current units were [i.e. inches]
    4. Parce the entry, perhaps first checking for the distance value, and separate out the angle entry to process separately.
    5. Check if there is a comma, indicating x,y entry, and process each separately.
    6. Look for any symbols or text that will indicate the units being entered. E.g. mm=Millimeters, a ' indicates architectural units.
    7. Architectural and fractional inches require some extra parcing and conversion to a decimal value.
    8. Convert the resulting value to the current units.
    9. Enter the value at the prompt, with the prefix @ and suffix of the angle if those were entered.


    Personally, I never use anything but the AutoCAD directional units in degrees. Though, perhaps the surveying folks would want more. Another limitation would be the lack of support for temporary reference points or coordinate filters [e.g. .x]

    -Joe

  2. #12
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,301
    Login to Give a bone
    0

    Default Re: Utilitiy to permit entering values in units other than what is set in drawing?

    You could simplify it if you just had separate functions for the few conversion types you need. It would work like running osnaps, e.g. END, INT, MID. For example, I suggested MMIN earlier for mm to inches. you could also have MFT for meters to feet.

    Command: CIRCLE
    Specify center point for circle or [3P/2P/Ttr (tan tan radius)]:
    Specify radius of circle or [Diameter]: 'MMIN
    >>>> Enter number of mm: 10
    Resuming CIRCLE command.
    Specify radius of circle or [Diameter]: 0.39370078740157
    Command:

    If you didn't want to remember all the options, you could have one CONVERT command and then prompt for options,

    Enter conversion Factor [MMIN, MFT, INMM, FTM] : <MMIN>
    C:> ED WORKING....

  3. #13
    Member
    Join Date
    2023-07
    Posts
    15
    Login to Give a bone
    0

    Default Re: Utilitiy to permit entering values in units other than what is set in drawing?

    It shouldn't be too hard to parse the user's entry. Though I don't recall ever trying to do this in LISP. I did a search to see if it is possible in VBA, and it is. https://help.autodesk.com/view/OARX/...B-2ED263678147. And since I am more familiar with VBA, I will probably do it with VBA.

    Since this has transitioned into a programming talk, I will take it to the programming forum for any further discussion. Though, I really don't know when I will devote time to it.

    Thank you all for the input.

    -Joe

  4. #14
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,301
    Login to Give a bone
    0

    Default Re: Utilitiy to permit entering values in units other than what is set in drawing?

    That's the same link I gave you earlier. It only applies to the arx api, which uses C++. VBA cannot intercept the command prompt. You can only send text to the prompt asynchronously. If you choose vba, you will have to write the whole command. Which means you will have to create a version for each command that creates an entity. e.g. line, arc, circle, polyline,etc. You can create a transparent command in lisp as I mentioned before or in .NET with a command attribute. The simplest way to go, in your case, would be to use lisp. You can usually get some help in the lisp forum. Try starting with this thread.
    Last edited by Ed Jobe; 2023-07-17 at 05:16 PM.
    C:> ED WORKING....

  5. #15
    Active Member dotson's Avatar
    Join Date
    2005-01
    Posts
    54
    Login to Give a bone
    0

    Default Re: Utilitiy to permit entering values in units other than what is set in drawing?

    > I've looked, but not yet found any utility programs that fix this limitation.

    If you were to consider third party add-ons, DotSoft's ToolPac ...
    https://www.dotsoft.com/toolpac.htm
    ...contains an Alternative Units transparent command. First you set the alternative units you want to work with from any CAD units (and some others like chains and links) and it remembers it. Then anytime you're in any command that asks for a real number (like a circle radius) you type 'AU (press enter) then enter the value in the alternative units and it's converted and pumped into the command.

  6. #16
    Member
    Join Date
    2023-07
    Posts
    15
    Login to Give a bone
    0

    Default Re: Utilitiy to permit entering values in units other than what is set in drawing?

    Thank you for correcting me. My understanding of the more advanced stuff is quite limited.
    -Joe

Page 2 of 2 FirstFirst 12

Similar Threads

  1. 2019: Permit Drawing Set v. Construction Documents
    By andipiper in forum Revit Architecture - General
    Replies: 4
    Last Post: 2020-08-10, 06:42 PM
  2. More Units, more units, more units, more units
    By Wish List System in forum Revit MEP - Wish List
    Replies: 0
    Last Post: 2014-10-27, 01:47 PM
  3. Replies: 4
    Last Post: 2008-11-13, 05:36 AM
  4. Can't import all .dwt files into 2006 Publish Utilitiy
    By jorywb88968 in forum AutoCAD Plotting
    Replies: 3
    Last Post: 2005-06-15, 01:17 PM

Posting Permissions

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