Add tables to Layout

Add tables to Layout

Anonymous
Not applicable
2,555 Views
4 Replies
Message 1 of 5

Add tables to Layout

Anonymous
Not applicable

Hello All,

 

Is there a way to create the table in the layout or export an existing table to the C3D layout, in such a way that I can fit maximum tables and split long tables so that I can place them side by side? 

 

Any inputs?

Thanks in advance.

0 Likes
2,556 Views
4 Replies
Replies (4)
Message 2 of 5

norman.yuan
Mentor
Mentor

Firstly, are you familiar to the process of creating a table, and break it as needed as CAD user?

 

There is not difference of creating table in ModelSpace or PaperSpace/Layout , so I am not sure you specifically mention creating table in "Layout". I am also not sure what it means by saying "export existing table...": export from where? a table from another drawing, or a table from different document other than AutoCAD drawing?

 

Since you are asking in Customization forum, and based on your previous post a few days ago, I assume you want to do it programmatically by code (AutoCAD .NET API).

 

So, the answer is yes, table can be broken into multiple chunks, as they can be by CAD user manually (by dragging the "break" grip at the bottom of the table). You are to look at these properties/methods:

 

BreakEnabled

BreakOption

BreakFlowDirection

SetBreakHeight()

SetBreakOffset()

SetBreakSpacing()

 

In code, you basically test the table's total height after the table is created/identified, and then if the height is greater than the allowed space for the table in the layout, you set a proper break height (SetBreakHeight()), so the table would break at given height and place the chopped portion to next table chuck(s).

 

Again, if you have ever done the table breaking as CAD user, you would not have difficulty to understand the API properties/methods and use it in your code.

 

In case you have not done it as CAD user, this video would be the start point:

https://www.youtube.com/watch?v=By5Tlw7pRyU 

 

HTH

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 5

Anonymous
Not applicable

hello @norman.yuan 

 

Actually I am not familiar with the manual process. 

 

I am learning the process as I am programming it. And yes i wish to do this programmatically.

Thank you for sharing the methods and the link, I will explore further on this.

 

I have already created the tables and now wish to add it to the layout using a viewport. 

I have understood the Model Space and Paper Space, but I am not able to find a way to add the tables to the viewport


Trying to find a sample code to start with.. Could you share any link that I can use to start with?

Thank you again and appreciate the support.

 

0 Likes
Message 4 of 5

priya.mishraTPDMG
Participant
Participant

Hello @norman.yuan 

I am also trying to do the same thing. The first image has tables in the model space.

 

image.png

 

The second image - I am trying to get the tables in the viewport such that they are aligned. I am asking the user to pick a point to place the table. Can I use this location to align it in the viewport? 

 

image.png

 

I am very new to this and I'm trying to find this for a while. Any suggestions?

 

Thanks in advance.

0 Likes
Message 5 of 5

norman.yuan
Mentor
Mentor

You DO NOT ADD something (table, in your case) to a viewport in a layout. Viewport in layout is something like opening a window on a wall, so that you inside the wall can see through the window to the outside (ModelSpace); and what you can see would depend on how big the window is, how far you from the window, which direction the window faces....

 

In your case, you have table in ModelSapce, and want it to be seen from, say, Layout1. So, you would:

1. Open a viewport in Layout1,

2. Aim the viewport to the target you want to see, that is, set the Viewport's ViewCenter/ViewTarget/ViewDirection...

3. Set the viewport's Standard/CustomScale

 

So, your issue is to learn how to create a viewport in a Layout to properly present drawing content in ModelSpace. This document would be where you get started from:

 

https://help.autodesk.com/view/OARX/2019/ENU/?guid=GUID-4B512161-DBD4-43DA-BD89-AA2EA564F9F9 

 

HTH

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes