I want to implement zoom in or out the current ModelSpace in AutoCAD2022 like using the mouse wheel to zoom in or out by using C# .NET API. I use the following code but it just can scale the modelspace to max display all entities. If I want to zoom
in or out the modelspace by custom specific scale, How can I achieve this. My code is below.
editor.Command("_.ZOOM", "_E");
I would appreciate it if anyone could provide a simple example.
Solved! Go to Solution.
Solved by jelly_oy. Go to Solution.
Zoom works with :
absolute : n
relative : nx
absolute in paperspace viewports : nxp
zoom
3
zoom
3x
zoom
3xp
"_e" stands for "Extend"
I guessthe answer is
editor.Command("_.ZOOM", ".5x"); (out)
editor.Command("_.ZOOM", "2x"); (in)
If you are sending the command (as it looks like) change E to a numeric value. 1 will zoom in by a factor of 1. to zoom out change it to a decimal .1 etc.
You will likely need to adjust those values to something more appropriate to what you are trying to achieve.
CADnoob
hi my dear friends, Thank you very much for your reply and suggestion, I will try it by using decimal parameters.
I use the following two line codes to resolved my problem.
editor.Command("_.ZOOM", "_E");
editor.Command("_.ZOOM", ".2");
Thank you all for reply to my question.
Can't find what you're looking for? Ask the community or share your knowledge.