Hi,
AutoCAD does not know a unit of type "pixel", however AutoCAD has a sysvar UNITMODE and you can change that in the database:
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database.Unitmode
Important: AutoCAD does use this setting only for some functions like INSERT/XREF/... but at least the UNITs-setting is just for orientation for you and nothing else. If you draw a line of 20 length, for AutoCAD 20 is nothing else but 20 "AutoCAD-UNIT"s, it's not inch, not meter, not lightyears and so you can say: for me 1 AutoCAD-UNIT is 1 pixel.
More important is to use the command scale that gives the geometry the size you wish to have on the end (and if your drawing is inserted into any other drawing that is get's the size it should get ... and of course there is also no unit "pixel" in the nature). 😉
HTH, - alfred -
------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ...
blog.ish-solutions.at ...
LinkedIn ...
CDay 2026------------------------------------------------------------------------------------
(not an Autodesk consultant)