Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: problem about C# addin propertyhandler

$
0
0
Thank you. Some of the concepts from your reply make me a little confused. I am not so clear about the difference between COM Application object or standard MicroStation NET addin.
I costomized several properties(BHEC_name,BHEC_type and so on) by sending keyins( app.CadInputQueue.SendKeyin("ECX Instance AttachWithStoredSchema TestSchema:CostomAtt")) within my code. I can get the property values with VBA code,but it doesn't work as well in c#. My code is as follows:

BCOM.PropertyHandler oPH = myEQ.ComApp.CreatePropertyHandler(m_cellElement);
string[] acc = oPH.GetAccessStrings();

foreach (string ss in acc)
{
MessageBox.Show(ss);
}
// so far in the for loop, the variable ss subsequently indicates that those properties mentioned below exist. I can see the properties in my dgn and alse can deal with those properties using VBA.

//But here comes the problem: I fail to set the value via C#
oPH.SelectByAccessString("BHEC_length");
oPH.SetValue(sdr["BHEC_length"].ToString());
oPH.SelectByAccessString("BHEC_name");
oPH.SetValue(eqname);
oPH.SelectByAccessString("BHEC_type");
oPH.SetValue(table);
oPH.SelectByAccessString("BHEC_width");
oPH.SetValue(sdr["BHEC_width"].ToString());
oPH.SelectByAccessString("DB_stat");
oPH.SetValue("0");
oPH.SelectByAccessString("DlinkNum");
oPH.SetValue(sdr["DlinkNum"].ToString());



so I check by this code MessageBox.Show(meoPH.SelectByAccessString("BHEC_length").toString()), the result shows "false". What's the problem here ?

Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>