PDA

View Full Version : Free Custom SPPID 2009 DLL



sppider
01-27-2010, 09:03 AM
This is free for members only. Here is how it works:

ver 1.1 edit:

Extract the dtcom.ini file to your Reference Data folder. Then open the ini file and type the names of the SOURCE and DEST (destination) fields you will be using. These must be the database field names and not the alias names.
Extract the dtcom.dll to your C:\Program Files\SmartPlant\P&ID Workstation\Program and register it. Start > Run > "regsvr32 C:\Program Files\SmartPlant\P&ID Workstation\Program\copyProp.dll "
Open DDM and double click on the SOURCE field. This is the field you want to grab the data from. In the ValidationID box, type "copy.copyProp" (w/out quotes)- then save/close.
If the ValidationID box is already populated, you can put the copy.copyProp value in the ProgID of the source field in item tag config.
NEW FOR ver 1.1 - SQL Query function - OK so first let me say that you could seriously mess things up if you don't know what you're doing here and I accept 0 responsibility if you do! You have been warned. To enable the use of SQL query function: change the UseSQLStatement value to 1 > Enter a valid connect string to your project database > Enter a valid SQL statement. When the dll gets called, the SQL query will be executed and a single string value will be returned and inserted into the DESTINATION field.
The dll's function is to copy the property defined in the ini files sourceproperty to the destproperty for that object. Handy for copying values from one field to another automatically. Such as operating temperature to insulation temp.

*Remove the 2k7 or 2k9 from the DLL name before registering it. The name should only be copyProp.dll. Hope it helps!

The way it's set up by default is to copy the ItemTag into the Name field, but you should be able to use any properties you want. Good luck!

dave
01-27-2010, 09:15 AM
Thanks SPPIDer! Works great!

I highly reccomend you DON'T add SP_ID to the dest field!!!

Plz add that exception to your code.

Patrick_Aps
01-27-2010, 09:58 PM
Thanks Spider,
this just might be handy somewhere in the future.

dave
01-29-2010, 08:16 AM
sppider, can you please recompile the dll for 2007 users as well?

sppider
01-29-2010, 09:34 PM
Dave, I will do both of those thanks.

Patrick, no worries! If you need something else don't be afraid to ask ;)

Jules
02-07-2012, 12:44 PM
Hi sppider, I'm new at the forum, but I have one question. In your first post you said that this can be used to copy properties like the Operating Temperature to the Insulation Temperature, how can I do that? if I open DDM this two properties I believe are linked to the case and there are not directly in the DDM.
Little help here!
Thanks in advance

RainRiku
02-19-2012, 09:26 PM
Can this be use in 2007..??..

if not please compile them..

Thank you

sppider
05-21-2012, 09:47 AM
@Jules, Operating Temperature database name is "ProcessOperating.Max.Temperature"

@RainRiku, I will try to do that for you today.

sppider
05-22-2012, 09:46 AM
I have updated the DLL and added the 2007 version. Please leave me some feedback if you like it or you need something fixed.

dave
05-22-2012, 01:26 PM
annnd tested, works great! Thanks sppider!

I left the theSQLStatement=0 in the ini file. I plan on testing that later.

Patrick Aps would know better but I don't think you can screw up your database unless you are trying to INSERT/DELETE etc... Performing a SELECT query shouldn't harm anything. Also, I would recommend that administrators make the file read only.

RainRiku
05-22-2012, 05:54 PM
Thanks sppider..it is very useful..B)