Centroid Property Preciscion

Centroid Property Preciscion

Julio_Soto
Advisor Advisor
238 Views
2 Replies
Message 1 of 3

Centroid Property Preciscion

Julio_Soto
Advisor
Advisor

When I dump the properties of some 3d solids I notice the Centroid property only shows 1 decimal place of precision. It shows this no mater what I set my units to. Is this correct?

Julio_Soto_0-1685073859883.png

 

0 Likes
239 Views
2 Replies
Replies (2)
Message 2 of 3

Moshe-A
Mentor
Mentor

@Julio_Soto  hi,

 

As far as can see the 'Centroid' has it's internal accuracy level. if it's xxxx.0 then it's 0.000

if it's xxxx.5 that its 0.500 etc.

 

try to change a bit the 3dsolid and see if this true?!

 

Moshe

 

 

0 Likes
Message 3 of 3

CADaSchtroumpf
Advisor
Advisor

Use (rtos) for have the max digits.

 

((lambda ( / ss Obj Centroid)
	(while (not (setq ss (ssget "_+.:E:S" '((0 . "REGION,3DSOLID"))))))
	(setq
		Obj (vlax-ename->vla-object (ssname ss 0))
		Centroid (vlax-Get Obj 'Centroid)
	)
	(princ
		(strcat
			"X=" (rtos (car Centroid) 2 16)
			" Y=" (rtos (cadr Centroid) 2 16)
			(if (caddr Centroid)
				(strcat " Z=" (rtos (caddr Centroid) 2 16))
				""
			)
		)
	)
	(prin1)
))

 

0 Likes