﻿ ZWCAD Tip: X and Y Ordinate Dimension in a Single Step - Dicas e Truques - Cost-effective CAD/CAM for AEC & MCAD | ZWSOFT.com

# ALL Produtos Serviço e suporte Testemunhais Centro de Imprensa function all_ni_ma(){ document.getElementById('ma_de_bi').value='search'; document.getElementById('cao_ni_ma').value='init'; document.getElementById('ma_bi').name=''; document.getElementById('siteid').name='siteid'; } function madebi(){ document.getElementById('ma_de_bi').value='content'; document.getElementById('cao_ni_ma').value='lists'; document.getElementById('ma_bi').name='catid'; document.getElementById('siteid').name=''; }   Português Deutsch English Español Italiano Português Русский 日本語 简体中文   Compre Agora! Facebook Twitter Linkedin Youtube Google+

ZWCAD Tip: X and Y Ordinate Dimension in a Single Step

Q: Ordinate dimensions are essential elements of geographic drawings. Ordinate dimensions enable you to indicate positional information of objects and geometry. For my work, I almost always need to place x and y ordinates at the same time. Is this possible?

A: Fortunately, ZWCAD makes it possible to create new commands through the use of the LISP application interface. With the help of the following LISP routine, it is possible to place x and y ordinate dimensions in a single step.

;;(User-defined variable names are boldfaced.)
(defun c:OXY()
(setq pt (getpoint "Input point: "))
(setq zg 5); text height is 5)
(setq x (car pt))
(setq xzb (strcat "X="(rtos x 2 2)))
(setq yzb (strcat "Y="(rtos y 2 2)))
(setq num (strlen xzb))
;;(command "text" (list (+ x 2) (+ y 2)) zg "" xzb "")
(command "text" (list (+ x 2) (+ y 2)) zg "" xzb)
(command "pline" (list (+ x 2) y) (list (+ x 2 (* (* zg 0.85) num)) y) "")
;;(command "text" (list (+ x 2) (- y 5.5)) zg "" yzb "")
(command "text" (list (+ x 2) (- y 5.5)) zg "" yzb)
(princ)
)

To use this code, follow these steps:
1. Copy and paste the above code to a Notepad file.
2. Save the file as OXY.LSP. (Be sure to modify the txt extension to lsp.)