I'm reading pairs of sub-model-name & entity-name from a spreadsheet, and want to add the entities to the submodel, and the relationships between them.
First I'm adding the entities to the sub-models as follows...
For i = 2 To rowcount
submdlName = ..<getting from spreadsheet row, works fine>
eName = ..<getting from spreadsheet row, works fine>
submdl = ..<find submdl, that works fine> submdl.EntityDisplays.Add(eName) Nextis the red line correct? The code above does seem to work ok. The entities do get added to the submodelsbut I then need to add the relationships to the sub-model, which I can't figure out. I'm just guessing. For Each submdl In mdl.SubModels
If Not submdl.MainSubModel Then
For Each eDisp In submdl.EntityDisplays
ent = eDisp.ParentEntity
For Each rel In ent.ParentRelationships ' determine if the parent entity of the relationship is also in the submodel
eDisp = submdl.EntityDisplays.Item(rel.ParentEntity.ID) ???
If eDisp <> Null ??? Then
I couldn't find any sample macros to give clues, and I don't know where else to look for detailed help.
Take a look at the macro called:
IMPORT OBJECT DEFINITION AND NOTES FROM EXCEL
Thanks Arthur, I've been using that macro for some other purposes, but it doesn't deal with the 'RelationshipDisplays' issue. I think the 'Import Relationships From Excel.bas' mentioned by someone will do it.