scaled value of the referenced IMAGE entity (in DXF)

scaled value of the referenced IMAGE entity (in DXF)

FELIXJMELO
Contributor Contributor
693 Views
3 Replies
Message 1 of 4

scaled value of the referenced IMAGE entity (in DXF)

FELIXJMELO
Contributor
Contributor

Can you know the scale value in DXF of the IMAGE object?

0 Likes
694 Views
3 Replies
Replies (3)
Message 2 of 4

Sea-Haven
Mentor
Mentor

Quick answer is probably yes, you would have to find the image entry in the file then look for the DXF code for the scale.

 

Just type this on command line and look at the assoc codes. (entget (car (entsel))) pick a image.

 

0 Likes
Message 3 of 4

dbhunia
Advisor
Advisor

As far I know there is no DXF Group code from which you can get the scale value of the IMAGE object directly .......

Check >>THIS<< 

 

You have to do this to get the scale value of the IMAGE object.......

 

(defun C:RAS_SCALE( / Ent U_Vec Pix_Size) 
(setq Ent (entget (car (entsel "\nSelect Raster Object: ")))) 
(if Ent 
	(if (= (cdr (assoc '0 Ent)) "IMAGE") 
		(progn 
			(setq U_Vec (distance '(0.0 0.0 0.0) (cdr (assoc 11 Ent)))) 
			(setq Pix_Size (car (cdr (assoc 13 Ent)))) 
			(princ (strcat "\nImage Scale: " (rtos (* U_Vec Pix_Size) 2 4))) 
		) 
	) 
) 
(princ)
)

 

or using vla.........try like this (if an object has Scalefactor property).......

 

(vla-get-Scalefactor (vlax-ename->vla-object (car(entsel))))

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
Message 4 of 4

MICROCADDAER6
Explorer
Explorer

Perfect.

Thank you.

ok.

0 Likes