How to Get data from autocad block into revit family as shown on below img

for placing blocks Aussie BIM Guru - YouTube this video helped me, @AussieBIMGuru Thankyou .

@vikas.kpoojary ,

i am not sure , but check out GeniusLoci package!

KR

Andreas

1 Like

There is the LinkDWG2 package for Dynamo which may be able to assist - Aussie BIM Guru has a video on how to use this link. Unfortunately I believe this requires an active AutoCAD application to be running in the background.

1 Like

I can confirm it does, and I believe it may not work in all cases. As far as i know this is the only method available that isnt commercially sold. The nodes are all in Python so you could learn from it and adjust to suit potentially.

As an alternative consider developing a workflow around the Dataextract command and look into Bird tools who have an app for doing what I do at scale with block to family mapping.

1 Like

You can access the AutoCAD api from Revit and side load the DWG.
Below is a minimal example.

I suggest looking at Kean Walmsley’s blog Through the Interface for solutions. Most of the examples are in C# however you can parse the Python equivalent (perhaps even use ChatGPT?)

See also AutoCAD API .NET documentation

import clr
from System.IO import FileShare

clr.AddReference("AcDbMgd")
from Autodesk.AutoCAD.DatabaseServices import *

dwglink = IN[0]

with Database(False, True) as db:
    db.ReadDwgFile(dwglink, FileShare.ReadWrite, False, "")
    with db.TransactionManager.StartTransaction() as t:
        blocktable = db.BlockTableId.GetObject(OpenMode.ForRead)
        output = [btr.GetObject(OpenMode.ForRead).Name for btr in blocktable]
        # Do more stuff here
        t.Commit()
OUT = output