joe Guest Jun 28, 2018 #1 Hello, I look for a lisp routine that can extract the value of the centerpiece, of any object, found by the massprop command. Thank you.
Hello, I look for a lisp routine that can extract the value of the centerpiece, of any object, found by the massprop command. Thank you.
rpor66 Guest Jun 28, 2018 #2 inside the lisp you find the centerid command; returns a list with the x y z coordinates of the central point and also the weight command with the text "the weight is kg" Attachments CalcoloPeso.LSP CalcoloPeso.LSP 1.3 KB · Views: 43 Last edited by a moderator: Jun 28, 2018
inside the lisp you find the centerid command; returns a list with the x y z coordinates of the central point and also the weight command with the text "the weight is kg"
joe Guest Jun 28, 2018 #4 excuse but the following code, which would serve me to detect the center of a solid, gives me as a result on the command line: 0.0.0.0.0 (defun c:ba (/ fr x y z txt peso nomefile) (setq filename "c:/users/salvator/massprop.mpr") (setq ent (car (entsel "\nselect solid: ") (command "_massprop" ent "_y" filename) (if (/= (findfile nomefile) nil) (progn) (setq fr) (repeat 9) (setq txt (read-line fr) ) (setq x (atof) (substr txt 26)) (setq txt (read-line fr) (setq y (atof) (substr txt 26)) (setq txt (read-line fr) (setq z) (substr txt 26)) (close fr) (vl-file-delete filename) (list x y z) ) (alert "problem with file creation") ) )
excuse but the following code, which would serve me to detect the center of a solid, gives me as a result on the command line: 0.0.0.0.0 (defun c:ba (/ fr x y z txt peso nomefile) (setq filename "c:/users/salvator/massprop.mpr") (setq ent (car (entsel "\nselect solid: ") (command "_massprop" ent "_y" filename) (if (/= (findfile nomefile) nil) (progn) (setq fr) (repeat 9) (setq txt (read-line fr) ) (setq x (atof) (substr txt 26)) (setq txt (read-line fr) (setq y (atof) (substr txt 26)) (setq txt (read-line fr) (setq z) (substr txt 26)) (close fr) (vl-file-delete filename) (list x y z) ) (alert "problem with file creation") ) )
joe Guest Jun 29, 2018 #7 result: select a solid; error: no function definition: vlax-ename->vla-object