I’m reassigning pipe structure names and using the civilobjects.setname node. The error being called out is
Warning: CivilObject.SetName operation failed.
Error: string contents for attribute ‘FRP3/SW/R/12B/4’ contain invalid characters. The following characters are not valid in object names: <>/":;=|,*?`
because there are forward slashes in the name. Does anyone have a work around other than omitting the forward slash? If I manually input the name in civil3d then it allows the forward slash. Perhaps another node suggestion to rename structures?
import sys
import clr
clr.AddReference('AcMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AeccDbMgd')
clr.AddReference('ProtoGeometry')
clr.AddReference('AeccPressurePipesMgd')
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *
from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *
from System.Collections.Generic import Dictionary
from System import *
#from System.Linq import *
#from System import Linq
adoc = Application.DocumentManager.MdiActiveDocument
cdoc = CivilApplication.ActiveDocument
from Autodesk.DesignScript.Geometry import *
def dynamic_oStruct(dynamics):
global adoc
global cdoc
output = []
if not dynamics:
return
if not isinstance(dynamics, list):
dynamics = [dynamics]
with adoc.LockDocument():
with adoc.Database as db:
with db.TransactionManager.StartTransaction() as t:
for dynam in dynamics:
vals = []
StructId = dynam.InternalObjectId
Struct = t.GetObject(StructId, OpenMode.ForWrite)
oStruct = Struct.AcadObject
oStruct.Name = oStruct.Name + " / test!"
output.append(oStruct.Name)
t.Commit()
return output
OUT = dynamic_oStruct(IN[0])