measure in paper space
greetings
I have a question, in Autocad 2007, if you have any line with a specific length in the MODEL space, and switch to PAPER space and make a viewport with any other scale, the size of the line will look different, but when you measure with DIST this line in PAPER moder, the result is the length of the MODEL space, example:
I draw a line of 10 units in MODEL SPACE, after in PAPER SPACE I do a viewport with custom scale of 10, if you use dist en MODEL space, the line will have 10 units, but if you measure the same line in the PAPER space (witout switch to model space) in its viewport, the measure will be 10 units too. THIS HAPPEN IN AUTOCAD 2007.
in BRICSCAD does not. the measure in model space will be 10 units and the paper space will be 100 units, my question is:
HOW CAN I MEASURE THE LINE IN PAPER SPACE AND BRICSCAD GIVE ME THE VALUE OF THE LINE FROM MODEL SPACE WITHOUT SWITCH TO THE MODEL SPACE LIKE AUTOCAD?
thanks a lot
Comments
-
Jorge,
If the system variable DIMASSOC is set to 2 (to create associative dimensions) Bricscad will create a dimension that labels the model space length.
Another possibility is to use a lisp function to convert picked points from paperspace to the display coordinate system of a model space view port using trans like so:
;; ugly hack to determine model space distance from paper space
(defun C:MDI ( / )
(distance
(trans (getpoint "Starting point for distance: ") 3 2)
(trans (getpoint "End point: ") 3 2)
)
)0 -
hi Greg
thanks for your answer, but I tried to use DIMASSOC modifying its values, but this is for the dimensions lines (NOT for dist command). I have been reading in Autodesk website and this interesting way to measure in paper space is a bug of Autocad 2007, and they give a routine to fix it:
(strcat "Distance "(rtos(getdist"First point: ")))
About your routine what exactly gives as result? I don't know how programming in LISP, but if you want to help me, the proccess for doing a routine will be this:
call the dist command, take the result (this value is from paper sapce) and divide this result between the value in the Custom Scale of the current viewport.
is it possible to do this in a lisp routine?
thanks a lot
0 -
Jorge, try this. Are you comfortable with loading lisp files?
(defun C:MyDI ( / spt ept old_err old_ce my_err)
;; Local error function
(defun my_err ( msg )
(if
(not
(member msg '("Function cancelled"
"quit / exit abort"
"console break"
)
)
)
(princ (strcat "\nError: " msg))
)
(if old_ce (setvar "CMDECHO" old_ce))
(if old_err (progn (setq *error* old_err)))
(princ)
)
;; Setup...
(setq
old_err *error*
*error* my_err
old_ce (getvar "CMDECHO")
)
(setvar "CMDECHO" 0)
;; Get two points for the distance
(initget 1)
(setq spt (getpoint "Starting point for distance: "))
(initget 1)
(setq ept (getpoint "End point: " spt))
(cond
((and
(= (getvar "TILEMODE") 0)
(= (getvar "CVPORT") 1))
;; layout tab and paper space so use trans
(command "._DIST" (trans spt 3 2) (trans ept 3 2))
)
(T
;; already in model space just call DIST
(command "._DIST" spt ept)
)
)
;; Restore settings
(setvar "CMDECHO" old_ce)
(if old_err (setq *error* old_err))
(princ)
)0 -
Muchas Gracias! jajaja
thanks Greg, your routine works great, very very good.
one question. What means your question? "are you comfortable with loading lisp files?" Why this questions?
again, thank you very much. I would like to learn lisp, but sometimes the time is not enough and should do it by myself, because here in my country, there is not any place to learn. LOL.
sorry for my bad english.
regards,
0 -
Jorge, glad it was useful to you. The "are you comfortable with loading lisp files?" question just meant are you able to do it or should I explain how. But I see you are ok with that.
As far as learning... the little I know was learned by trying and reading myself but I am by no means an expert :-)
0 -
Oh, yeah... I forgot to mention that this approach will only provide a 2D distance when measuring in paper space so be careful if you have elevations in your geometry. You will not get the true 3D length.
0 -
More correctly, the distance in the 2D distance in the model space display coordinate system so it you were to change the view plane (with 3d orbit for example) the result would be different from the paper space measurement.
0