4

I can see my column comments through double-clicking on table and selecting a Columns tab. But when I choose Display Preferenses-> Table-> Advanced...-> Columns-> List Columns [select] - I cant't find this attribute "Comment" there.

Is it possible to add the attribute ColumnComment from the model to be shown in Physical Diagram, and how?

egor7
  • 4,678
  • 7
  • 31
  • 55

2 Answers2

4

You can't add it directly because they are rtf texts not simple strings,
so this kind of attributes are not listed.

But there is a workaround!
You can add an custom calculated attribute to columns which will return the converted string from description (comment)

First of all you have to add an Extension to your PDM model,
go to Model->Extensions and add a new one,
then follow these instructions:

Open properties of newly created extension
Select Profile and right click, select Add Metaclasses, check Column and press OK.
Select Column and right click, select New->Extended Attribute
Give it a name
Select data type string
Check Computed
Select Read only (Get method)
Select Get Method Script tab
Replace

%Get% = ""

with

%Get% = Rtf2Ascii (obj.Description)

Press OK to close the extension properties window.
Press OK to close the extension list window.

Now open Tools->Display Preferences->Table->Advanced->Columns
Click Select for columns list Check your new attribute and press OK three times to return to diagram

enter image description here
Enjoy

MtwStark
  • 3,866
  • 1
  • 18
  • 32
  • 3
    My database is mysql , Replace %Get% = "" with %Get% = Rtf2Ascii (obj.Comment) is work for me . – Steve Jiang Dec 18 '17 at 09:17
  • 1
    Good idea. You could create the extension through `Tools > Extensions > All Model Types..`, to make it a global reusable one. And attach the extended attribute to NamedObject (in Add Metaclass, go to PdCommon tab, and modify the filter to select `Show Abstract Modeling Metaclasses`) to make it available on all objects having a description. – pascal Jul 20 '18 at 08:19
1

I put %Get% = obj.Comment instead of %Get% = "" - and it works, but %Get% = Rtf2Ascii (obj.Description) - doesn't

(PD 16.6.)

JimHawkins
  • 4,843
  • 8
  • 35
  • 55