Read a Dynamic Block Properties Table and Fill out a Combo Box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Using AutoCAD 2024 Visual Studio and C#, I have created a Tool Palette with a Control Form in it. The Control Form has a list box that reads a list of drawings from a database and points to drawing files on our network. If I select an item from this list box, AutoCAD is able to locate the corresponding DWG file that is a dynamic block of a fastener (screw). These fastener drawings have a dynamic block table with visibility states for Top View, Side View Solid, Side View Hidden, etc. If I insert the fastener drawing into my current drawing, it works great. I have the triangle icon that I can select the dynamic block table and make my selections to get the view that I want.
What I’m looking for help with is: 1) When a fastener is selected in the Tool Palette Control Form, I want to read the dynamic block properties table from the target drawing located on the network, that will be inserted, and then populate the columns into drop-down combo boxes in the Control Form. 2) Once the combo boxes have options, selections can be made for Orientation (Top or Side), Head (Solid or Hidden), Shaft (Solid or Hidden), and Head Rotation (Point to Point or Flat). 3) Once selections are made, the dynamic block is inserted into the current drawing using the appropriate visibility state based on the selections.
I’ve been struggling with writing the code to get to the Dynamic Block Properties Table. I need to locate the drawing, which I’ve been able to do, but extracting the data from the Dynamic Block Properties Table and then knowing how to populate the combo-boxes has been my problem. Any pointers in the right direction would be greatly appreciated.