You are on page 1of 1

Welcome, stpandi Notifications My Profile Settings Log Out

Forum

New Posts Private Messages FAQ Calendar Community Forum Actions Quick Links

Advanced Search
Forum PDMS/E3D Forum A VEVA Ev ery thing3D How to set DESLNK attribute of C YMLNK element in c#

Results 1 to 3 of 3
+ Reply to Thread
Thread: How to set DESLNK attribute of CYMLNK element in c#

Thread Tools Search Thread Rate This Thread Display

9th O ctober 2020 #1

HenningNT
How to set DESLNK attribute of CYMLNK element in c#
Branch Member
Join Date: Aug 2020 It lo o k s lik e the DESLNK a ttribute e x pe cts a n ELEMENT a s va lue , but I ge t a n e rro r whe n I try to se t the va lue .
Location: Norway Lik e this
Posts: 5 cym link .Se tAttribute (AT T.DESLNK, de sEle m );

o r this
cym link .Se tAttribute (AT T.DESLNK, ne w DbQ ua lifie r(), e ngEle m , o ut va r ldk fjghsldk jhfglsk j);

T he e rro r is a lwa ys "Da ta o f wro ng type fo r a ttribute DESLNK"

Lo o k ing a t the a ttribute in Visua l Studio 'Im m e dia te windo w' give s us
AT T.DESLNK
{DESLNK}
C a te go ry: ""
De fa ultUnit: {}
De scriptio n: "C o nne ctivity De sign Mo de l Link "
Dim e nsio n: {NO NE}
Ha shVa lue : 166059778
Hype rlink : fa lse
IsArra y: true
IsP se udo : true
IsSyno nym : fa lse
IsUDA: fa lse
IsVa lid: true
Ma x im um Size : 20
Na m e : "DESLNK"
Q ue ryTe x t: "De sLnk "
Sho rtNa m e : "DESLNK"
Type : ELEMENT
Units: NO NE
hidde n: fa lse
isTa ble : true
pro te ct: fa lse

I'm a ssum ing ELEMENT m e a ns it is a n DbEle m e nt in C #. Is this a ssum ptio n co rre ct?
If no t, ho w do I se t the DESLNK a ttribute va lue ?

Reply Reply With Quote

12th O ctober 2020 #2

h3nrik Yo u ca nno t se t the de slnk a ttribute , it is a pse udo a ttribute .


Site Level
Ma ybe if yo u che ck this dll, Aveva.Pdms.DataManagement.PML, yo u'll se e ho w to cre a te it
Join Date: Oct 2009
Location: Sweden
Posts: 379

Reply Reply With Quote

16th O ctober 2020 #3

HenningNT I figure d it o ut e ve ntua lly...


Branch Member
priva te vo id C re a te Engine e ringlink (DbEle m e nt e ngine e ringEle m e nt, DbEle m e nt de sEle m e nt)
Join Date: Aug 2020
{
Location: Norway
// Ge t la te st da ta
Posts: 5 MDB.C urre ntMDB.Ge tW o rk ();
va r re fDa ta = MDB.C urre ntMDB.FindEle m e nts(DbType .De sign, "/*").First(e l => e l.Db.Na m e .C o nta ins("R EFDATA"));
va r cym Grp = re fDa ta .FindFirstC hildO fType (DbEle m e ntType Insta nce .C Y MGR P );
va r cym link = cym Grp.La stMe m be r().C re a te Afte r(DbEle m e ntType Insta nce .C Y MLNK);
va r de sLnk = DbAttribute .Ge tDbAttribute (AT T.DESLNK.Ha shVa lue );
cym link .Se tAttribute (de sLnk , ne w DbEle m e nt[] { de sEle m e nt });
cym link .Se tAttribute (AT T.ENGLNK, e ngine e ringEle m e nt);
_lo gge r.Info rm a tio n("C re a te d {cym link } be twe e n {e ngine e ringEle m e nt} a nd {De sigEle m e nt}", cym link , e ngine e ringEle m e nt, de sEle m e nt);
}

FindFirstC hildO fType is a n e x te nsio n m e tho d I m a de to ge t the gro up tha t ha s the cum lnk e le m e nts.

public sta tic DbEle m e nt FindFirstC hildO fType (this DbEle m e nt e le m e nt, DbEle m e ntType type , string e le m e ntNa m e )
{
va r childre n = e le m e nt.Me m be rs();
// C he ck if a ny o f childre n ha s right type
va r first = childre n.FirstO rDe fa ult(e le => e le .Ele m e ntType .Equa ls(type ) && e le .Na m e ().Equa ls(e le m e ntNa m e , StringC o m pa riso n.Inva ria ntC ulture ));
if (first != de fa ult) re turn first;
// R e curse o ve r childre n
fo re a ch (va r ite m in e le m e nt.Me m be rs())
{
va r child = FindFirstC hildO fType (ite m , type , e le m e ntNa m e );
if (child != de fa ult && child.Ele m e ntType .Equa ls(type ) && child.Na m e ().Equa ls(e le m e ntNa m e , StringC o m pa riso n.Inva ria ntC ulture ))
{
re turn child;
}
}
re turn de fa ult;
}

Reply Reply With Quote

+ Reply to Thread Q uick N av igation AVEVA Everything3D Top

Q uick reply

Post Quick Reply Go Advanced Cancel

« Prev ious Thread | Next Thread »

Similar T hr eads

Element contains an inv alid database attribute LO O S Replies: 9


By RICARDOWASICKY in forum PDMS 12 Last Post: 4th October 2016, 15:40

Element branch xxx-xx-x-xxx-x/b1 doesnot hav e attribute propre Replies: 6


By Mandark in forum Iso Draft Last Post: 20th March 2012, 09:37

A ttribute reference a non-existent or corrupt element Replies: 5


By mrkan in forum Draft Module Last Post: 11th January 2011, 03:20

find exact attribute of element Replies: 2


By amitvedak in forum PML and PML2 Last Post: 14th August 2007, 13:39

A dd Model Element By A ttribute W ithin a Volume Replies: 3


By gdwatkins in forum Design Module Last Post: 2nd July 2007, 01:13

T ags for this T hr ead

None
View Tag C loud Add / Edit Tags

P osting P er missions

You may post new threads BB code is O n


You may post replies Smilies are O n
You may post attachments [IMG] code is O n
You may edit y our posts [VIDEO] code is O n
HTML code is O ff
Forum Rules

C ontact Us A v ev a W orld Forum A rchiv e Terms of Serv ice Top

All times are GMT -5. The time now is 03:08.

Powered by vBulletin® Version 4.2.5


Copyright © 2021 vBulletin Solutions Inc. All rights reserved.

This forum website is operated by AVEVA employees and customers.

You might also like