CoPointGroup can be deleted through an external connection to the Objet.Delete node.But in Python, I can call the Objet.Delete to delete objects like TinSurface , but it fails to delete CoPointGroup
, resulting in an error when executed.
import sys
import clr
# 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 DSCore
from DSCore import *
# Import references from Civil3D
from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *
from Autodesk.Civil.DynamoNodes import *
clr.AddReference('ProtoGeometry')
import Autodesk
from Autodesk.DesignScript.Geometry import *
import DynamoNodes
dataEnteringNode = IN
surface_ori = IN[0]#接收原始曲面
cogo_point_group = Autodesk.Civil.DynamoNodes.CogoPointGroup.GetCogoPointGroupByName("_No Display")
#Autodesk.AutoCAD.DynamoNodes.Object.Delete(surface_ori)#delete a Tinsurface.WORK!
#Autodesk.AutoCAD.DynamoNodes.Object.Delete(cogo_point_group)#delete a CoPointGroup.WORONG!
OUT = cogo_point_group