Hello I’m a beginner when it comes to dynamo and scripts as a whole so apologise if this is a simple ask !
I’m using a script that was developed in order to import CAD lines into a REVIT format but I’m wondering if there is a way to bring text associated with it across aswell ive done some digging and apparently the code to select text from CAD is (ssget “_X” '((0.“TEXT”))) and then in order to make it layer dependant I need to add (ssget “_X” '((0.“TEXT”) (8.“Mylayer”))) But everytime I create this block it gives me a closeparren Expected error.
Actually, I am pretty sure you could use the AutoCAD api to pull the data that way. No publicly available package I know of exposes it, but you could look at the LinkDWG package for other element types and decipher where to go from there.
Hey, good shout… This is in LinkDWG… It backgrounds opens the CAD file… any suggestions on casting a System._ComObject to a Text Element or reading it’s information?!
Edit: It looks like the Python contains the code that the OP was trying to use…
Hi thanks for all the information provided ! ill have a bit more of a play around today with this new stuff and see what happens ! Anything else that may help would be much appreciated aswell !
Is it possible to delete layers of an imported cad and then explode through api? If it is, then it would technically be possible to delete all layers except the ones you need, explode, find all text notes with their text and position, then undo the explode and delete.
(BimorphNodes v3.0 ETA March/April). It avoids explode too, since there is a risk of hitting the 10000 element limit, so it uses an alternative route to only target the MTEXT and TEXT objects in the file.
Yeah sure, I’m using netDXF library, so the process involves exporting the import instance to DXF, parsing with the netDXF library then converting the text objects to strings and origins to Dynamo points.