AutoCAD 2010/2011/2012

Reply
Active Contributor
M_Mogharabi
Posts: 26
Registered: ‎12-12-2011
Message 1 of 3 (363 Views)
Accepted Solution

setting image size

363 Views, 2 Replies
02-18-2012 09:58 PM

hi all.

I 'm attaching images through c# using lisp _image  and sendcommand in a predefined rectangle.

how can I specify width and height of the image so the image is exactly placed inside the area that I want?

(scale is not a good option because as image ratio changes scale must also change).

thanks in advance.

Hi,

 

you have to go via scale-factors as AutoCAD does not have properties for SizeX and SizeY. So you have to check the imagesize (width & height) and with that you have to calculate the scalefactors for X and Y.

 

BTW: working with C#, using LISP ... to run SendCommand ==> it's not the most direct way to go, is there a reason why you do that in this way?

If it's just knowledge ... try >>>this link<<< from Kean Walmsley.

 

- alfred -

*Expert Elite*
Alfred.NESWADBA
Posts: 9,398
Registered: ‎06-29-2007
Message 2 of 3 (351 Views)

Re: setting image size

02-19-2012 01:11 AM in reply to: M_Mogharabi

Hi,

 

you have to go via scale-factors as AutoCAD does not have properties for SizeX and SizeY. So you have to check the imagesize (width & height) and with that you have to calculate the scalefactors for X and Y.

 

BTW: working with C#, using LISP ... to run SendCommand ==> it's not the most direct way to go, is there a reason why you do that in this way?

If it's just knowledge ... try >>>this link<<< from Kean Walmsley.

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Active Contributor
M_Mogharabi
Posts: 26
Registered: ‎12-12-2011
Message 3 of 3 (331 Views)

Re: setting image size

02-21-2012 12:50 AM in reply to: Alfred.NESWADBA

thanks for the reply.

I tried the approach in the link you gave avd it worked.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!