Add a comments for tables columns in a physical data diagram

旧巷老猫 提交于 2020-01-14 19:16:06

问题


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?


回答1:


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


Enjoy




回答2:


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

(PD 16.6.)



来源:https://stackoverflow.com/questions/40283974/add-a-comments-for-tables-columns-in-a-physical-data-diagram

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!