Schneider Electric GIS Tech Support

Forum discussion for Schneider Electric GIS products, including ArcFM, ArcFM Viewer, Designer, Responder, and others.
It is currently Sun May 19, 2013 6:34 pm

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Read CU attributes
PostPosted: Tue Nov 23, 2010 1:51 pm 
Offline

Joined: Wed Jul 09, 2008 12:29 pm
Posts: 34
Location: Clark PUD, Vancouver, WA
I would like to be able to read the CU fields, like description, wms code, and unit of measure, for just a single CU. I'll have the CU Name and want to get the other attributes for this CU. I found IMMPersistInfo but not sure if I should be using that or how to implement it. Any help would be appreciated. Thanks :)


Top
 Profile  
 
 Post subject: Re: Read CU attributes
PostPosted: Tue Nov 23, 2010 4:52 pm 
Offline
Telvent North America Rep
User avatar

Joined: Wed Aug 18, 2010 4:09 pm
Posts: 108
Location: Fort Collins, Colorado
You might try using the MMDesignerUtils class, and the IMMDesignerUtils interface. That's probably the easiest way to get CUs, then you don't have to worry about deserializing them from a blob in the table. On the IMMDesignerUtils interface there is a "FindCU" method which has a number of optional parameters. I don't see a name property, but maybe you can get the list of CUs for a particular feature class, then iterate through the list that's returns. Or...maybe you can use the WMSCode?

Might that work?


Top
 Profile  
 
 Post subject: Re: Read CU attributes
PostPosted: Tue Nov 23, 2010 7:04 pm 
Offline

Joined: Wed Jul 09, 2008 12:29 pm
Posts: 34
Location: Clark PUD, Vancouver, WA
The documentation says this interface allows me to search for specific objects on the CU tab. I won't have a design open when I'm looking for a specific CU. The CU will be selected in Favorites Manager. Can I still use that? The documentation is pretty non-informative.


Top
 Profile  
 
 Post subject: Re: Read CU attributes
PostPosted: Tue Nov 23, 2010 7:53 pm 
Offline
Telvent North America Rep
User avatar

Joined: Wed Aug 18, 2010 4:09 pm
Posts: 108
Location: Fort Collins, Colorado
Dori Bearham wrote:
The documentation says this interface allows me to search for specific objects on the CU tab. I won't have a design open when I'm looking for a specific CU. The CU will be selected in Favorites Manager. Can I still use that? The documentation is pretty non-informative.


The CU tab will populate once you start editing, no design required. Will that work? Actually, if you are talking ArcCatalog we might be back to loading it from the blob. :-(


Top
 Profile  
 
 Post subject: Re: Read CU attributes
PostPosted: Wed Nov 24, 2010 12:54 pm 
Offline

Joined: Wed Jul 09, 2008 12:29 pm
Posts: 34
Location: Clark PUD, Vancouver, WA
Yeah, I'm talking ArcCatalog. What I'm trying to do is give the CU administrator the ability to update a CU in the WFM CU Library whenever they make a change in the Designer CUs (Favorites Manager). So I'm thinking I need to read the BLOB and then figure out how to decipher it.


Top
 Profile  
 
 Post subject: Re: Read CU attributes
PostPosted: Wed Nov 24, 2010 1:15 pm 
Offline
Telvent North America Rep
User avatar

Joined: Wed Aug 18, 2010 4:09 pm
Posts: 108
Location: Fort Collins, Colorado
Awhile back you were loading it to an XML, could modifying the XML be an option (then writing it back into storage)?


Top
 Profile  
 
 Post subject: Re: Read CU attributes
PostPosted: Wed Nov 24, 2010 3:55 pm 
Offline

Joined: Wed Jul 09, 2008 12:29 pm
Posts: 34
Location: Clark PUD, Vancouver, WA
I was hoping to not have to use XML but I think that's the only way at this point. I'll create the XML (I know how to do that now) and then read the CU data from the XML. Thanks for your help! :)


Top
 Profile  
 
 Post subject: Re: Read CU attributes
PostPosted: Wed Nov 24, 2010 4:28 pm 
Offline
Telvent North America Rep
User avatar

Joined: Wed Aug 18, 2010 4:09 pm
Posts: 108
Location: Fort Collins, Colorado
Dori Bearham wrote:
I was hoping to not have to use XML but I think that's the only way at this point. I'll create the XML (I know how to do that now) and then read the CU data from the XML. Thanks for your help! :)


I think XML is probably the easiest way, but I'll see what I can dig up for reading from blob contents. :-)


Top
 Profile  
 
 Post subject: Re: Read CU attributes
PostPosted: Wed Nov 24, 2010 4:41 pm 
Offline
Telvent North America Rep
User avatar

Joined: Wed Aug 18, 2010 4:09 pm
Posts: 108
Location: Fort Collins, Colorado
Here is some vb6 code I dug up that we use on the Compatible Units tab. This should work in ArcCatalog too, you just need to get the workspace (GxSelectedObject)

Code:
Dim pLI As ID8ListItem
Dim pPLI As IMMPersistentListItem
Dim pCuType As IMMCategory
Dim pListItemEx As ID8ListItemEx

Set pCuType = New D8CuType
pCuType.Description = "Compatible Units"
pCuType.Owner = cuoSystem
pCuType.Type = cutCUCompatibleUnitCategory
Set pLI = pCuType
Set pPLI = pLI

If pPLI.CanLoadFromDB(<your workspace>) Then
   pPLI.LoadFromDB "mmSystemCUs", <your workspace>
        pPLI.SetDirty False ' Set not dirty after load.
        Set pLI = pPLI
End If

Dim pList as ID8List
Set pList = New D8List
pList.AddFront pLi

//now you have a list of compatible units, you can iterate this list and get each MMCompatibleUnit object
//and query it for properties (Name, Description, etc). Attributes exist as ID8ListItem children on each MMCU
//object (ID8CuDefAttrib) which have name/value properties
//
//Take the same code above and us IMMPersistentListItem to write it back to the database (e.g. Can SaveToDB, and SaveToDB)


Top
 Profile  
 
 Post subject: Re: Read CU attributes
PostPosted: Wed Nov 24, 2010 4:50 pm 
Offline

Joined: Wed Jul 09, 2008 12:29 pm
Posts: 34
Location: Clark PUD, Vancouver, WA
Thank you! I almost had that but couldn't figure out what LoadFromDB returned. Aha, it's a list. I'll give that a try.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group