See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Calculator that works with mtext

  1. #1
    Member Jettero2112's Avatar
    Join Date
    2000-12
    Posts
    24
    Login to Give a bone
    0

    Question Calculator that works with mtext

    I'm looking for a calculator type utility that will run in AutoCAD to be used to automatically add the findings to mtext.

    I would use it when creating metal roof panel drawings. Need to be able to select a line (roof panel) multiply that number (length) by the slope factor and have the answer be able to display as mtext. A calculator type utility would be perfect. Be able to store the slope factor in memory, input the panel length and select an mtext to output the answer. Being able to automatically add a suffix everytime would be a wonderful bonus.

    Hoping someone may have heard of something like this. Thanks.

  2. #2
    Member
    Join Date
    2004-12
    Posts
    18
    Login to Give a bone
    0

    Default Re: Calculator that works with mtext

    "QuickCalc" command in 06+

  3. #3
    Wish List Manager BrenBren's Avatar
    Join Date
    2000-11
    Location
    150700
    Posts
    3,439
    Login to Give a bone
    0

    Default Re: Calculator that works with mtext

    Quickcalc will not work when in mtext; this is currently a wish in the AutoCAD Wish List Forum.

  4. #4
    Member Jettero2112's Avatar
    Join Date
    2000-12
    Posts
    24
    Login to Give a bone
    0

    Default Re: Calculator that works with mtext

    Quote Originally Posted by prichardson
    "QuickCalc" command in 06+
    Figures. We're still stuck with '05. Trying to get us upgraded but management....yada yada yada. Thanks for the help.

  5. #5
    Member Jettero2112's Avatar
    Join Date
    2000-12
    Posts
    24
    Login to Give a bone
    0

    Default Re: Calculator that works with mtext

    Quote Originally Posted by BrenBren
    Quickcalc will not work when in mtext; this is currently a wish in the AutoCAD Wish List Forum.
    AH! Caught between posts. Hopefully someone will have heard of a lisp or VBA routine that could help me out. Thanks for your input, greatly appreciated.

  6. #6
    Member
    Join Date
    2004-12
    Posts
    18
    Login to Give a bone
    0

    Default Re: Calculator that works with mtext

    Quote Originally Posted by BrenBren
    Quickcalc will not work when in mtext; this is currently a wish in the AutoCAD Wish List Forum.
    Thanks,

    Sorry for the bad info, I didn't realize it didn't work
    work with MTEXT. I should have tried first.

  7. #7
    100 Club intergrupocr's Avatar
    Join Date
    2006-02
    Posts
    116
    Login to Give a bone
    0

    Default Re: Calculator that works with mtext

    In your MText are only a number? or the number is part of something bigger?

    If it has only The number is easier to program something.

  8. #8
    Member Jettero2112's Avatar
    Join Date
    2000-12
    Posts
    24
    Login to Give a bone
    0

    Default Re: Calculator that works with mtext

    Quote Originally Posted by intergrupocr
    In your MText are only a number? or the number is part of something bigger?

    If it has only The number is easier to program something.
    We would use it to add mtext for panel lengths. Usually the callouts on the drawings look something like this : 1 @ 24'-6". The suffix is almost always "1 @". To get the 24'-6" number I'd multiply the panel (line) length on the drawing and multiply it by a slope factor (3:12 slope = 1.0308 slope factor, etc). Sometimes I need to add or subtract a few inches to make up for panel hems, setbacks at the ridge or extensions at the eave. For a drawing with several hundred different panel lengths, it's time consuming, monotonous and extremely boring. Anything to speed up the task would be wonderful.

  9. #9
    I could stop if I wanted to
    Join Date
    2002-02
    Location
    Kansas
    Posts
    487
    Login to Give a bone
    1

    Default Re: Calculator that works with mtext

    Try this code

    Code:
    (DEFUN C:CALMTEXT  (/ myline mymtext mylinedata mydist mytextdata newtext)
      (setq myline nil
     mymtext nil)
      (setq myline (selectObject "LINE" nil))
      (if (= nil myline)
    	(progn	;no Line Selected
    	  (alert "No Line Selected")
    	  )
    	(progn	;a Line was seected
    	  (setq myLineData (entget myline)) ;get the data for the line
    	  (setq myMtext (selectobject "MTEXT" nil))
    	  (if (= nil myMtext)
     (progn	;No Mytext Selected
       (alert "No Mytext Selected")
       )
     (progn	;Mytext was Selected
       (if (= nil myslope);if slope not set get slope
    	 (setq myslope (getreal "\nEnter Slope"))
    	 )
       (setq mydist (distance (cdr (assoc 10 myLineData))
    		  (cdr (assoc 11 myLineData))))
       (setq mydist (* mydist myslope))
       (setq mypfix (getstring "\nPrefix String"));get a Prefis string put 
       (setq mysFix (getstring "\nSuffix String"));Get a suffix string
       (setq newText (strcat mypfix  (rtos mydist 2 2)  mysfix));can change mode or precision
       (setq myTextdata (entget mymtext))
       (setq mytextdata
       (subst (cons 1 newtext)
       (assoc 1 mytextdata)
       mytextdata))
       (entmod mytextdata)
       )
     )
    	  )
    	)
      )
    ;;Function Selectobject
    ;;ObjectType uper case name of Object to Select
    ;;Exp "LINE" "MTEXT"
    ;;Alertflag not nil to show alerts
    ;;		  nil to show alerts
    ;;retrun the entityname of the selected entity
    ;; or nil if no enity Selected
    (DEFUN SelectObject  (ObjectType AlertFlag / myline myLineData)
      (setq myline nil)
      (setq myline (car (entsel (strcat "\nSelect a " ObjectType))))
      (if (= nil myline)
    	(progn	;no Object Selected
    	  (if AlertFlag
     (alert "No Objec Select"))
    	  )
    	(progn	;a Object was seected
    	  (setq myLineData (cdr (assoc 0 (entget myline))))
    	 ;get the data for the line
    	  (if (/= myLineData ObjectType)
     (progn	;Object not a line
       (if AlertFlag
    	 (progn
    	   (alert (strcat "You Did Not Select a " ObjectType))
    	   (setq myline nil))
    	 )
       )
     (progn	;Object was type Objectype
      )
     )
    	  )
    	)
      (setq myline myline)
      )

  10. #10
    Member Jettero2112's Avatar
    Join Date
    2000-12
    Posts
    24
    Login to Give a bone
    0

    Thumbs up Re: Calculator that works with mtext

    Quote Originally Posted by jwanstaett
    Try this code
    WOW. Very Cool and Groovy! Thanks! I do have a few observations, though.

    • Won't let me put a space in the suffix or prefix (1 @ xx'-x")
    • Uses decimal units, can this be adjusted to architectural?
    • Only allows you to input the slope factor once. The second time it's run, it skips that question. I have multiple slopes on one drawing. If it would ask you again but give you the option of using the last slope number input.
    • Is there any way to be able to add or subtract a number from the final output before changing the mtext? (want to add or subtract a couple inches from the final number).
    This routine is pretty friggin' cool. Thanks for the help, it's very greatly appreciated!

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 1
    Last Post: 2011-12-14, 11:51 PM
  2. Calculator?
    By david_peterson in forum Revit Structure - General
    Replies: 10
    Last Post: 2009-07-22, 03:11 PM
  3. calculator
    By kornackiph in forum Revit Structure - Wish List
    Replies: 3
    Last Post: 2007-09-17, 11:05 PM
  4. Replies: 3
    Last Post: 2006-10-31, 05:46 PM
  5. MText Calculator, testers required
    By Tommy Kinard in forum VBA/COM Interop
    Replies: 0
    Last Post: 2006-10-09, 06:31 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
  •