Skip to Content

Instead of writing my VB code for every different excel sheet and/or model type…

… i recently started using the XEM Excel_Import!

Lets give it a closer look about the whys and specially about the HOW.

Assume you have different models, say CDM and PDM and you want to import a xls source like that:

execltest1.PNG

and you can import this table without coding as a cdm, pdm or whatever it fits model!

Yes, you want this feature, but how ?

Just add the model extention Excel_Import.xem to your model

(menu model:extentions, in the dialog select attach extention and you´ll find it on the tab import!):

execltest2.PNG

Now you can use it by right clicking on the model name and selecting Import Excel File:

execltest3.PNG

in the dialog, select a file, leave the options unchanged for now and press next:

execltest4.PNG

as you see then in the selection box, there are all CDM model specific Attributes available:

execltest5.PNG

but even when we want to create an entity, our excel list is a list of entity attributes!:

execltest6.PNG

now step by step associate the excel columns with some attribute:

execltest7.PNG

fieldnumber i put in description because i am interested about the order later (or not: then deactivate the button Import column)

But to get an Entity object we HAVE TO associate the entity/table whatevername with the <parent> object so our list of attributes gets a father:

execltest8.PNG

the other attributes: fieldname i put onto name or code , fieldtype on datatype and so on

execltest9.PNG

the second table i dont want for now, so i deselect it and next, the import starts and :

execltest10.PNG

here we are!

try the same with a PDM import its working !!!


Enjoy!!!

DJ

PS: please rate this, cos i wanna know if its worth to continue

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. George McGeachie

    Nice post, Dirk.

    I would avoid overloading your attribute properties by using the Description property to hold the field sequence number. The Excel import allows you to import into a new property – just click on the ‘New’ button to the right of the suggested property name (labelled as ‘Attribute’), and type in the name of the new property. PD will create a new model extension to document the new property.

    (0) 
    1. dirk jaeckel Post author

      Thx for the like and rating, this should be a first shot, not everybody knows all the features but when someone points on it then people startt playing with it.

      Feel free to help me with enlighting  😉

      (0) 
  2. George McGeachie

    Here’s another tip – reduce the effort involved in mapping the Excel file, by selecting “Auto-map columns to properties’ in the import options, and making sure your Excel sheet and column names match the PD metamodel names.

    For example, for a LDM import call your sheets:

    • Entity
    • Entity.Entity Attribute
    • Domain
    • Business Rule
    • etc

    In the Entity.Entity Attribute sheet, use the following column names:

    • Entity
    • Name
    • Domain
    • Description

    Be absolutely sure that you’re populating the correct PD properties, there may be a ‘hidden’ property with the same name as one of your Excel columns with the wrong meaning/usage. Experiment with an empty model.

    (0) 

Leave a Reply