Recenter active viewport from a pointgroup

Evening all,

I’m trying to figure out how I can recenter an active viewport in Civil 3D based on a specific point. There is one point in a point group that we are using to be the center of the viewport. I have been able to get the northing and eastings pulled out as double, but I can not find a node that will let me recenter an active viewport.

Figured it out:

import System
from System import *
from Autodesk.AutoCAD.ApplicationServices import *

output = “Error”
Easting = IN[0]
Northing = IN[1]

command = “zoom\nC\n”+IN[0]+“,”+IN[1]+“\n”+“\n”
OUT = command
adoc = Application.DocumentManager.MdiActiveDocument
adoc.SendStringToExecute(command, True, False, False)

3 Likes