I’m using sendcommand to draw various shapes in autocad.
the problem is my application (wpf) uses pixel units while autocad uses inches by default.
how can I change autocad units to pixel programmatically?
thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The AutoCAD units represent “real world” distances, and pixels represent “on screen” distances. You need to decide what real world distance a pixel should equate to inside your dwg.
If you want the exact same size on screen you need to take into account zoom settings and so-on, and I wouldn’t hold much hope of getting it all that accurate.
I would also avoid imperial measurements like the plague, especially for what you’re doing. Set your AutoCAD to work with metric units unless you really must use imperial.
It seems a pretty trivial choice so I’d go for a very “linear” ratio for pixel to unit, like 1:1 or 1:100 and then play with the zoom.