• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

extract the value of the centerpiece

  • Thread starter Thread starter joe
  • Start date Start date

joe

Guest
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.
 
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

Last edited by a moderator:
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")
)
)
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top