Sub DateChange() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oRevTb As RevisionTable Set oRevTb = oDoc.ActiveSheet.RevisionTables.Item(1) Dim oLatestRow As RevisionTableRow Set oLatestRow = oRevTb.RevisionTableRows.Item(oRevTb.RevisionTableRows.Count) Dim oValue As RevisionTableCell Set oValue = oLatestRow.Item(3) oValue.FormattedText =? 'I need a static value End Sub
What to write to get static value of revison table cell.
-karthikeyan
Here you go:
Sub DateChange() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oRevTb As RevisionTable Set oRevTb = oDoc.ActiveSheet.RevisionTables.Item(1) Dim oLatestRow As RevisionTableRow Set oLatestRow = oRevTb.RevisionTableRows.Item(oRevTb.RevisionTableRows.Count) Dim oCell As RevisionTableCell Set oCell = oLatestRow.Item(3)
Dim oValue As String
oValue = oCell.Text End Sub
Sub DateChange() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oRevTb As RevisionTable Set oRevTb = oDoc.ActiveSheet.RevisionTables.Item(1) Dim oLatestRow As RevisionTableRow Set oLatestRow = oRevTb.RevisionTableRows.Item(oRevTb.RevisionTableRows.Count) Dim oCell As RevisionTableCell Set oCell = oLatestRow.Item(3) Dim oVal As String oVal = oCell.Text oCell.Text = oVal End Sub
your code has some error. Please check . Above code also not working.
I can't see the issue in it. Both reading and writing to the cells is working for me.
Can you test the iLogic code below, instead of VBA?
Also, what are you trying to achieve? Read the value or write to it?
Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument Dim oRevTb As RevisionTable = oDoc.ActiveSheet.RevisionTables.Item(1) Dim oLatestRow As RevisionTableRow = oRevTb.RevisionTableRows.Item(oRevTb.RevisionTableRows.Count) Dim oCell As RevisionTableCell = oLatestRow.Item(3)
'Read the value Dim oVal As String = oCell.Text MsgBox(oVal)
'Write to it
oCell.Text = "something"
Hi,
I have a Revision table cell with duplicate value.(If it is a duplicate value cell will be in blue color). Now i want to right click the cell and make it static value. Screen shot is attached. This i want to achieve it in vba. Already static value change ilogic program available in the forum. But my question is y we r unable to achieve this in vba. After run vba program table should look like stat 2 attachment. not like stat11 attachment.
Well, I've looked into it and I couldn't find any way to do this.
Maybe someone from @autodesk could help.
Mike is correct, the API doesn't currently support the ability to get or set if a cell in a revision table is set to "Static". It would be best to request this on the IdeaStation so the request doesn't get lost and it can be prioritized with other work.
Hi
Don't know if this will help or not but.... I had some small issues with static values in a parts list so instead, I looped through the columns and changed the values that way. Maybe it could be a similar thing for the revision table? I haven't checked..
Here is my code
Private Const sColumnTitle As String = "DRAWING"
Dim oPartsList As PartsList Dim ic As Integer For ic = 1 To oSheet.PartsLists.Count Set oPartsList = oSheet.PartsLists.Item(ic) Next Dim i As Long For i = 1 To oPartsList.PartsListRows.Count Dim oRow As PartsListRow Set oRow = oPartsList.PartsListRows.Item(i) ' Iterate through each column in the row. Dim j As Long For j = 1 To oPartsList.PartsListColumns.Count ' Get the current cell. Dim oCell As PartsListCell Set oCell = oRow.Item(j) ' Check that the column isn't the quantity column. If oPartsList.PartsListColumns.Item(j).Title = sColumnTitle Then If oCell.Value = "N/A" Then oCell.Value = "" oCell.Static = False End If End If Next Next
Cheers
Nacho
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Can't find what you're looking for? Ask the community or share your knowledge.