-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi, In short, you can’t, I don’t see that BricsCAD has enablers for these objects. Bricsys has a conversion tool in Cv to convert civil objects, but it seems its limited in scope specific civil objects The only option is to reverse engineer the object using a filer, which is very difficult, but not impossible. Filers are consistent, once you understand the behavior of an object, you can map out the data you need. It’s hard because you have to understand each item in in the filer. I can give you more details if you want to do a deem dive into the abyss. Basically, you have to compute the offset to the data item you need, they can be different, but it’s deterministic def getEntInfo(id: Db.ObjectId):
try:
obj = Db.DbObject(id)
print(obj.isA().name())
# play with the filer types
snoop = Db.SnoopDwgFiler(Db.FilerType.kCopyFiler)
obj.snoop(snoop)
idx = 0
for idx, item in enumerate(snoop.buffer()):
if "Byte" in item[0] or "Address" in item[0] or "PointerId" in item[0]:
continue
print("Index = {}, Value = {}".format(idx, item))
except Exception as err:
print(err)
@Ap.Command()
def doit():
try:
ps, id, _ = Ed.Editor.entSel("\nSelect: \n")
getEntInfo(id)
except Exception as err:
traceback.print_exception(err) |
Beta Was this translation helpful? Give feedback.
-
BTW, this is the conversion code I tried first, while it does not work with these objects, it might be useful # does not work with these objects
@Ap.Command()
def py_conv():
try:
db = Db.curDb()
ps, id, _ = Ed.Editor.entSel("\nSelect: ")
# only works with tin objects?
infos = []
converter = Cv.CvCivil3dConverter()
for info in converter.getCivilEntities():
print(info)
if info.objectId() == id:
infos.append(info)
if len(infos) == 0:
print("\nNothing")
return
# not a permanant conversion see getInsertedEntities
for info, newid in converter.convert(infos):
vals = []
for prop in Brx.DbProperties.listAll(newid):
isvalid, fqname = Brx.DbProperties.isValid(newid, prop)
if isvalid:
val = Brx.DbProperties.getValue(newid, prop)
vals.append((prop, val.dataType(), val.format()))
print(vals)
except Exception as err: |
Beta Was this translation helpful? Give feedback.
Hi,
In short, you can’t, I don’t see that BricsCAD has enablers for these objects. Bricsys has a conversion tool in Cv to convert civil objects, but it seems its limited in scope specific civil objects
The only option is to reverse engineer the object using a filer, which is very difficult, but not impossible. Filers are consistent, once you understand the behavior of an object, you can map out the data you need. It’s hard because you have to understand each item in in the filer. I can give you more details if you want to do a deem dive into the abyss.
Basically, you have to compute the offset to the data item you need, they can be different, but it’s deterministic