View Full Version : changing existing component's color
armin_eftekhari
01-04-2010, 02:42 PM
Hi every body and happy new year:)
Does any body know how can i change the color of the existing component,.
Based on my settings the component's color is based on Service but in order to be recognizable i want to have the Existing component with some other color. for instance if i change a component to existing its color turns to gray?:cool:
Zortar
01-04-2010, 02:51 PM
This would require some reprogramming in the C:\Program Files\Bentley\Plant XM\Modules\base\Common\compprop.ebs file. Existing/New is treated as an object linetype property so it won't be too simple but looks possible to me from scanning the code. Good luck.
Aplant Monkey
01-05-2010, 05:49 AM
you can also reset the the color file contained within a drawing. Once a drawing is created it has a color dictionary, if you want to make changes to the color.ini file you will need to reset this value. you can do this by the following
(at_PipingSystemColorTable_display) ; displays color table in text window
(at_PipingSystemColorTable_reset) ; reads in CONFIG.INI and updates values. Values that are in the existing dictionary, but not in the INI remain.
tkmashl
01-05-2010, 06:34 AM
if your data requirements are such that you could assign a unique service designation for existing stuff, you could just assign the color in the color.ini file.
Not an elegant solution but it could suit your purpose.
Good Luck!
TKM
armin_eftekhari
01-05-2010, 07:37 AM
Thank you all for your help,
i found the way. i have to edit the COMPPROP.EBS file as follow:
Go to the :Function at_ComponentProperties_getColor
and modify it as follow:
Case "5" '// By Service
status = at_Component_getString(compService, compID, "SERVICE")
status = at_Component_getInt(existingFlag, compID, "Existing" )
If (status = AT_SUCCESS) And (existingFlag = 1) Then
compColor = "your desired color number"
Else If (status = AT_SUCCESS) And (existingFlag = 0) Then
status = at_PipingSystem_getColorByValue(compColor, "ByService", compService)
End If
End If
------------------
it works perfect now.
thanks again for helping.
Zortar
01-05-2010, 07:45 AM
Thanks for sharing your solution, Armin!
HomerJ
01-14-2010, 06:38 AM
Armin,
There is one more thing you could do and that is create and 'ExistingByService' table in your color.ini file and then you could replace the line in your code.....
compColor = "your desired color number"
with....
status = at_PipingSystem_getColorByValue(compColor, "ExistingByService", compService)
Then you can define more than one colour for existing components.
HJS
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.