Connection to api com

Hello all
Has anyone tried this?
I tried but it doesn’t work for me
How to get to API com

Blockquote

FOR CIVIL 3D 2022 “AeccXUiLand.AeccApplication.13.4”

# Load the Python Standard and DesignScript Libraries
import sys
import clr

# Add Assemblies for AutoCAD and Civil3D
#clr.AddReference('Autodesk.AECC.Interop')
clr.AddReference('Autodesk.AEC.Interop.UIBase')
clr.AddReference('Autodesk.AECC.Interop.Land')
clr.AddReference('Autodesk.AECC.Interop.UiLand')
clr.AddReference('Autodesk.AEC.Interop.Base')
clr.AddReference('AcMgd')
clr.AddReference('AcCoreMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AecBaseMgd')
clr.AddReference('AecPropDataMgd')
clr.AddReference('AeccDbMgd')
# Import references from AutoCAD
from Autodesk.AutoCAD.Runtime import *
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.EditorInput import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *

# Import references from Civil3D
from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *


import Autodesk.AECC.Interop.Land
import Autodesk.AEC.Interop.Base
import Autodesk.AEC.Interop.UIBase
import Autodesk.AECC.Interop.UiLand
# The inputs to this node will be stored as a list in the IN variables.
Document = IN[0]
Databaseel = Autodesk.AEC.Interop.Base
DatabaLand = Autodesk.AECC.Interop.Land.AeccSites



import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
from math import *
import System
from System import Array




Databaseel = Autodesk.AECC.Interop.Land
CAD =System.Runtime.InteropServices.Marshal.GetActiveObject("Autocad.Application")
CADCC =CAD.GetInterfaceObject("AeccXUiLand.AeccApplication.13.4")
DOCv = CADCC.ActiveDocument
DOCNAME = DOCv.Name
DOCdata = DOCv.Database

output = []



for Surface in DOCv.Surfaces:
    output.append([Surface.Name])
    
    

for Site in DOCv.Sites:
    output.append([Site.Name]) 
    

for Alignment in DOCv.AlignmentsSiteless:
    output.append([Alignment.Name])     
   
OUT  =output  #Database

2 Likes