Select lines inside a linked CAD file, Is it possible ?

Select lines inside a linked CAD file, Is it possible ?

Anonymous
Not applicable
2,673 Views
3 Replies
Message 1 of 4

Select lines inside a linked CAD file, Is it possible ?

Anonymous
Not applicable

Hi

I want to select lines from a imported DWG file.

I do not want to import all the lines in the file or from a single layer, but only lines selected by the user,

 

It that possible ?  How ?

 

Regards

Anders

 

0 Likes
2,674 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk

Dear Anders,

 

If you want to do it programmatically, please determine whether it is possible in the user interface first.

 

However, since this discussion forum is dedicated to programming Revit using the Revit API, you might have better chances of getting a competent answer to that UI related question in one of the non-API Revit product support discussion forums instead for that:

 

https://forums.autodesk.com/t5/revit-api-forum/this-forum-is-for-revit-api-programming-questions-not...

 

The people there are much better equipped to answer your question than us programming nerds.

 

Please be aware that the Revit API hardly ever supports any functionality that is not also available in the user interface.

 

Therefore, if the UI does not support this, the API will probably not do so either.

 

So, it always helps to research the optimal manual approach to a solution first, before attacking the task programmatically.

 

I hope this clarifies.

 

Thank you for your cooperation and understanding.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 4

Anonymous
Not applicable

Hi Jeremy

Sorry I wasn't precise in my post,

I think it is implied, that the questions in this forum is about the API, sorry for that.

 

If I select a linked DWG file I got the Button "Query" in the UI, that tells me , the layer, line type etc at the selected line in the DWG.

That is why I thought that it could be possible to get some informsation from a selected line. 🙂

 

Best regrads

Anders

0 Likes
Message 4 of 4

jeremytammik
Autodesk
Autodesk

Dear Anders,

 

Thank you for clarifying.

 

Just about everything that is API accessible in the Revit database can also be accessed and explored using RevitLookup:

 

https://github.com/jeremytammik/RevitLookup

 

In some cases requiring slightly more convoluted combinations of API  calls, more flexible and powerful tools such as the Revit Python shell might be required:

 

https://thebuildingcoder.typepad.com/blog/2013/11/intimate-revit-database-exploration-with-the-pytho...

 

Maybe the lines in the DWG are accessible individually somewhere within the linked file geometry, and the properties you require might be found in there.

 

Update: on re-reading your question, I see that you are asking about exploring information on the lines in the linked `DWG file before it is linked in at all, and possibly import individual line information.

 

Obviously the Revit API cannot help you at all with that.

 

However, the AutoCAD .NET API can help you very much with that. You could use it to open the external DWG file, read its data, determine what lines yu need and import their information into Revit. As opposed to the Revit API, the AutoCAD .NET API can also be used without a running end user AutoCAD session.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes