How to zoom to a specific location in model space by using Dynamo for Civil 3D?
Try this (done with CPython so Civil 3D 2022) :
import System from System import * from Autodesk.AutoCAD.ApplicationServices import * output = "Error" FirstCorner = IN LastCorner = IN command = "zoom\nW\n"+IN+"\n"+IN+"\n" OUT = command adoc = Application.DocumentManager.MdiActiveDocument adoc.SendStringToExecute(command, True, False, False)
Forum_ZoomTo.dyn (34.9 KB)
all the dynamo nodes to get the point as string could have been included in the python node too, but anyway I went with doing it with dynamo
*edit - also I sent this quickly, started using variables and just realized that I didn’t used them on the command so yeah, no the best python code
Finally, robust way would be using the view class and not sending a command : Help
Thank you very much!