Jump to content

Recommended Posts

Posted

Is it possible to pin the menu option found  under Home / Utilities/ Measure / Distance, to measure distance on the screen?

This is the same item found under the _MeasureGeom /Distance command

regards,

PJ

Posted

You already know what command you want and where it is. Are you trying to copy it somewhere else?

Sorry just cannot figure out what you're looking for.

 

I use this lisp instead for distances and slopes:

;|      By Tom Beauford:
Dst.lsp will prompt the user to pick the first point, then pick the next point,
then display the distance picked by with a colored line, every distance measured
shows a different color. the bearing & horizontal distance will be displayed in
the left corner of the status line and the bearing, horizontal distance, difference
in elevation and slope will be displayed on the command line.
   Macro: ^P(or C:DST (load "DST.lsp"));DST
   Command line: (load "DST.lsp") DST
|;

(defun C:DST ( / *ERROR* 2DIST fact str1 tw CNTR PT1 PT2 ang DST PDST Pang)

 (defun *ERROR* (s)                    ; If an error (such as CTRL-C) occurs
                                      ; while this command is active...
  (if (/= s "Function cancelled")
    (princ (strcat "\nError: " s))
  )
  (grtext -1 "")                      ; Clear status line.
  (vl-cmdf "redraw")
  (princ)
 )

  (defun 2DIST (PT)
    (list (car pt)(cadr pt))
  ) ;defun

  (setq fact nil)
  (if(and(= 1 (getvar "cvport"))(trans '(1 0 0) 2 3 0))
    (progn
      (setq fact (car (trans '(1 0 0) 2 3 0)))
      (princ "\nPS:MS == 1:")
      (princ(/ 1 fact))
      (setvar "NOMUTT" 1)
      (command "mspace")
      (setq tw (- (* 2 pi)(cdr(assoc 51(entget(acet-currentviewport-ename))))))
      (command "pspace")
      (setvar "NOMUTT" 0)
    )
  )
  (setq CNTR 0 ;INITIALIZE COUNTER
        PT1 (getpoint "\nPick First Point") ;PROMPT FOR FIRST POINT
        PT2 PT1
  )
  (while PT2 ;IF YES OR ENTER
    (setq PT2 (getpoint "\nPick Next Point" PT1)) ;PROMPT FOR NEXT POINT
    (if PT2
      (progn
        (if fact
          (progn
            (setq DST (/ (distance (2DIST PT1)(2DIST PT2))fact) ;CONVERT TO STRING
                  PDST (distance (2DIST PT1)(2DIST PT2)) ;CONVERT TO STRING
                  CNTR (1+ CNTR) ;ADD TO COUNTER FOR COLOR CHANGE
                  Pang (angtos (angle pt1 pt2)4 4)
                  ang (angtos (+(angle pt1 pt2)tw)4 4)
                  deltaz  (/ (- (car(cddr pt2)) (car(cddr pt1)))fact)
                  slope   (/ deltaz DST)
            )
            (if(eq Pang ang)
              (setq DST(strcat "MS Bearing= "ang ", Dist= " (rtos DST 2 2) "', PS Dist= " (rtos PDST 2 2) "\""))
              (setq DST(strcat "MS Bearing= "ang ", Dist= " (rtos DST 2 2) "', PS Bearing= "Pang ", Dist= " (rtos PDST 2 2) "\""))
            );if
          );progn
          (setq DST (distance (2DIST PT1)(2DIST PT2))
                CNTR (1+ CNTR)
                ang (angtos (angle pt1 pt2)4 4)
                deltaz  (- (car(cddr pt2)) (car(cddr pt1)))
                slope   (/ deltaz DST)
                DST     (strcat "Bearing= "ang ", Dist= " (rtos DST 2 2) "'")
          )
        );if fact
        (if (/= 0 deltaz)
          (progn
            (cond
            ((equal (abs slope) (/ 1.0 2) 0.0001)(setq slope "2:1"))
            ((equal (abs slope) (/ 1.0 3) 0.0001)(setq slope "3:1"))
            ((equal (abs slope) (/ 1.0 4) 0.0001)(setq slope "4:1"))
            ((equal (abs slope) (/ 1.0 5) 0.0001)(setq slope "5:1"))
            ((equal (abs slope) (/ 1.0 6) 0.0001)(setq slope "6:1"))
            ((equal (abs slope) (/ 1.0 7) 0.0001)(setq slope "7:1"))
            ((equal (abs slope) (/ 1.0 8) 0.0001)(setq slope "8:1"))
            ((equal (abs slope) (/ 1.0 9) 0.0001)(setq slope "9:1"))
            ((equal (abs slope) (/ 1.0 10) 0.0001)(setq slope "10:1"))
            ((equal (abs slope) (/ 1.0 12) 0.0001)(setq slope "12:1"))
            ((equal (abs slope) (/ 1.0 15) 0.0001)(setq slope "15:1"))
            ((equal (abs slope) (/ 1.0 20) 0.0001)(setq slope "20:1"))
            ((equal (abs slope) (/ 1.0 30) 0.0001)(setq slope "30:1"))
            ((equal (abs slope) (/ 1.0 40) 0.0001)(setq slope "40:1"))
            ((equal (abs slope) (/ 1.0 50) 0.0001)(setq slope "50:1"))
            ((equal (abs slope) (/ 1.0 100) 0.0001)(setq slope "100:1"))
;            ((equal (abs slope) (/ 0.25 12) 0.0001)(setq slope "1/4\"=1'"))
            (T(setq slope (strcat (rtos (* slope 100) 2 4) "%")))
            )
            (setq DST (strcat DST "  Delta elev= "(rtos deltaz) "  Slope= " slope))
          );progn
        );if
        (prompt (strcat "\n" DST)) ;Print the distance to command line
        (grtext -1 DST) ;Print distance in status line
        (grdraw PT1 PT2 CNTR 2) ;Draw a colored line between points
        (setq PT1 PT2) ;Change start point
      ) ;end progn
    ) ;end if PT2
  ) ;end while PT2
  (grtext -1 "") ;Clear status line
  (vl-cmdf "redraw")
  (princ)
) ;end fun

 

Posted (edited)

 

Thank for this, Tom. I  would like the Distance measurement icon to be open on the screen all the time, as I use it a lot. Not interested in the others  - angle, radius etc

 

 

etcdistance.thumb.JPG.2bbf93b2d6f2d6778472fe89b591c275.JPG

Edited by PJ01
Posted

Why not just add Measure Distance to your Quick Access Toolbar where it would always be on the screen for you to use? 

Just hit the down-arrow at the right end of the QAT and select More Commands…

Scroll down and select Measure Distance.

 

If you're comfortable using the CUI adding the 'Layer List Combo Box' to the QAT adds a lot of layer control always on the screen which saves a lot of time as well. You have to search for it in 'Ribbon Control Elements'.

Posted

Thanks tombu, using the Quick Access Toolbar worked nicely.Thanks for describing the steps so neatly. Easy to follow. Never been there before

Is there any way I  can pin this in the workspace of the screen, next to the drawing I am working on?

Posted
9 hours ago, PJ01 said:

Thanks tombu, using the Quick Access Toolbar worked nicely.Thanks for describing the steps so neatly. Easy to follow. Never been there before

Is there any way I  can pin this in the workspace of the screen, next to the drawing I am working on?

Not sure what you're asking as the QAT by default is always above the drawing you're working on without obstructing any of the drawing workspace. A floating Toolbar that obstructs your view of the drawing workspace isn't something I'd recommend.

 

The default command alias for D is DIMSTYLE but you could change it to DIST which measures the distance and angle between two points with the Express Tool 'Command Aliases' or ALIASEDIT. You can only add a single command to a command alias so a macro like 'MEASUREGEOM Distance' isn't possible.

Posted

Thanks tombu, you  are very helpful, and what you say makes good sense. I should not obstruct the drawing. I  will stick with the QAT as you suggested.

Posted

Rather than the ribbon you can make your own toolbar, which has commands you want to use all the time. You make a mnu file using say Notepad very easy to do. I open the CUI and steal the macro and icon name from the cui paste into notepad. I have CIV3D so rather than changing workspaces made a menu combining CIV3d commands and Acad commands.

 

Again in CIV3D changing surface styles plus more is a 2-3 step process so made a tool bar to do the same with 1 toolbar pick choice.

 

If you say post a few commands will make a toolbar for you. Then you can add more commands

 

Distance

xxxxx

yyyyy

zzzzz

etc

 

image.thumb.png.aa65a5f02dff62fab4132ea28c503df9.png

image.png.cf3eef1c9750229644276e97d0210f27.png

Posted

DI is the shortcut for Distance, much quicker and better than the other options, as mentioned, you can change that as well.

 

Even better would be a programable mouse button, if you wanted to go that route.

 

You could also put it on the Right-Click menu.

 

If you use the ribbon full size like you show, once selected the default action will be Distance on that button, there isn't too much will be appreciably faster IMO.

  • Like 1
Posted
1 hour ago, SLW210 said:

You could also put it on the Right-Click menu.

If you want to do that open the CUI → Shortcut Menus → Context menu for default mode

In lower-left search for "Distance" in "ACAD Commands" then drag "Measure Distance" up and place it into the "Context menu for default mode" menu.

Context menu for default mode is the default Right-Click menu when nothing is selected and no commands are active.

I'm guessing that's when you'll be using Measure Distance.

 

The best thing about Right-Click menus is that when you have an Mtext object selected the Right-Click menu will just be for modifying that Mtext, when you have multiple polyline objects selected the Right-Click menu will just be for modifying multiple polylines. Since the Right-Click menus offer command options for your current selection set adding specific commands for modifying a specific object or objects gives you quick access to the commands you normally use to modify those object or objects without having to look for them in the ribbon or toolbars.

 

You should decide which location you prefer though. Lots of handy things you can put in both places but keeping anything in both places would clutter both the QAT and the Context menu for default mode. Less commands in both places make selecting them quicker. 

Posted (edited)

thanks for this SLW210 and tombu, it is a real eye opener. I  would like to put three commands on the right click default menu.

I  had never heard of CUI before, so this is a steep learning curve :)

I  was able to fit the "Measure distance " command in the right click default menu, and that now works beautifully.

 

I  put the Point command in too, but that would not work. When I  select that item on the menu, I get the message in the Command box :

_geomarkpoint: No geographic location defined

 

The other command I  use a lot is XLINE, but I  could not find  it in the list of Commands in the CUI

 

Can anyone please help with putting the POINT and the XLINE commands on the default right click menu?

 

Kind regards,

PJ

point-1.JPG

looking for XLINE.JPG

point-2.JPG

Edited by PJ01
typo
Posted
1 minute ago, PJ01 said:

thanks for this SLW210 and tombu, it is a real eye opener. I  would like to put three commands on the right click default menu.

I  had never heard of CUI before, so this is a steep learning curve :)

I  was able to fit the "Measure distance " command in the right click default menu, and that now works beautifully.

 

I  put the Point command in too, but that would not work. When I  select that item on the menu, I get the message in the Command box :

_geomarkpoint: No geographic location defined

 

The other command I  use a lot is XLINE, but I  could not find  it in the list of Commands in the CUI

 

Can anyone please help with pitting the POINT and the XLINE commands on the default right click menu?

 

Kind regards,

PJ

First open Your Roamable Support Folder by entering 

(startapp "explorer" (strcat "/n,/e," (getvar "roamablerootprefix")"Support"))

at the Command line then making a copy of the CUIX file you're modifying. I usually hold down the Ctrl key then drag and drop the CUIX file in the same folder to make the copy. Editing one of these can corrupt them sometimes. Always have a backup before editing.

 

There's a lot of commands that show when you search for point in the Command List. You want the one in your main CUIX file called "Point, Multiple Point". It's Macro will be *^C^C_point .

The GEOMARKPOINT (Command) is not what you're looking for.

 

Search for Construction Line in the Command List, after you select it you will see it's macro is ^C^C_xline . Command names in the CUI are more descriptive than the actual commands you type on the Command line.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...