Reply

Change the size of the Table in draft...

[ Edited ]

 

HI,,

      I want ot change the size of the table in the draft document...

Is it possible in solid edge. If yes a code snipppet or an API will help me a lot.

Thanks a lot.

 

Posted by: Pritam Dulam
Post date: 9/14/2009 10:44:34 PM

4 REPLIES

RE: Change the size of the Table in draft...

[ Edited ]

 

I know we've discussed this before somewhere in the forums.  The tables API is really weird and limited. 

I wrote the following code off the top of my head and I assumed VB6 because you didn't specify.  What I believe is a mistake in the API is that you access the Tables collection directly from the DraftDocument rather than a Sheet object.  To my knowledge, Tables are Sheet specific so it makes no sense to me.  Using my free Solid Edge Spy application, I don't see any way to change the size of the table though.  Sorry.Dim objApp as SolidEdge.ApplicationDim objDraft as SolidEdgeDraft.DraftDocumentDim objTables as SolidEdgeDraft.TablesDim objTable as SolidEdgeDraft.TableobjApp = GetObject(,"SolidEdge.Application")objDraft = objApp.ActiveDocumentobjTables = objDraft.TablesobjTable = objTables.Item(1)

 

Posted by: Jason Newell
Post date: 9/15/2009 12:17:20 AM

RE: Change the size of the Table in draft...

[ Edited ]

Once you have a hold of the table, you can edit the sizes by the columns and/or rows:

 

With objTable

 

objTable.Columns.Item(1).Width = .5

objTable.SetOrigin 0, 5

 

End With

 

Of course, you'll have to use proper factors for your values. I don't think you can change the Row Height, but you can change the sorting and the Values.

 

Posted by: Bill Ledbetter
Post date: 9/15/2009 12:48:36 AM

RE: Change the size of the Table in draft...

[ Edited ]

 

Hello,

I've also been playing with the table, and found out that the SolidEgde Spy isn't complete on this for as far I can see. The Table has got a Cell property in which you can get and set the value based on Row and Collomn index. Solid Edge Spy doesn't show this Cell property. I've found this via the Solid Egde ST SDK.

Maybe checking the Solid Egde ST SDK gets you further. Don't get me wrong; the Solid Egde Spy is a great tool, and I use it a lot!!

Best Regards,

Wouter (Erwo)

 

 

Posted by: Wouter Sloof
Post date: 9/27/2009 10:49:09 PM

RE: Change the size of the Table in draft...

[ Edited ]

 

Hi Jason,

I am wanting to work out what sheet a particular table is on via API in order to update that table which contains information relevant to the sheet that it is on.  As you said, the tables API is weird... 

What I have found is a reference to objDraft.sheets.item(x).DrawingObjects (where objDraft is SolidEdgeDraft.DraftDocument) .  The count for this changes when a table is added or subtracted from the sheet, however when I try to reference the new object via objDraft.sheets.item(x).DrawingObjects.item(y) where y is new number objects after pasting the table in, it throws a server exception and says there is no such interface supported.  (works fine for other object types such as lines and relations)

Is this just because they have not added the code to reference the tables this way in the API? (because it would seem this is where the table location is stored internally) 

Do you know of any way of programatically getting the sheet number a table is on?  I am using VB 2008.

I am placing the tables programatically anyway, so I suppose that I could add an extra non-visible title to store the active sheet number when it is originally placed, but if it gets copied to a different sheet that would stuff things up!  I look forward to your reply.

Best Regards,

Tom Harris

 

Posted by: Tom Harris
Post date: 7/11/2010 3:53:06 PM