Looking for help with the changes from MSSE to MS/J and then V8i concerning the old refFileP structure?

Probably not in the right forum but this BE isn't as user friendly as the old comp.cad or news.bentley etc.   Just an old timer I guess.

Anyway I wrote a PDS label reader long time ago in MSSE when the reference files where in refFileP.

It worked fine until MS/J and then if a ref had the path stored the MDL compiled on MSSE fails to find the path and returns garbage

I used strcpy (text, refFileP[fileno-1].file_id.pc_spec);

to get the path.

Now I know that the refFileP structure is not valid from MS/J onwards and I should use a library routine.

Has anyone done this already?   

What library routines in MS/J and V8i do I need to replace the above line with to get the full paths of reference files?

I'm going to have to dig out an old PC with a locked license to do recompile this.  Work is now on V8i  SE2 and doesn't give give staff Select accounts so I can download the latest mdl zip.   

Not sure I have the MS/J mdl  zips but I think MDL was still in the microstation setup so should have it.

Does anyone know if the latest PDS MS/J  uses new v8i home licences or will it accept an original MS/J node locked one?

Ps If any other people are interested in a recompiled PDSLabel.ma for MS/J or v*i let me know and I'll send it to you if I manage to recompile it.

Karsten Evans

  • Unknown said:
    I know that the refFileP structure is not valid from MS/J onwards and I should use a library routine

    The V8i MDL API is much richer than the V7 API.  For reference attachments (Note: attachments are models, not files) look at the mdlRefFile_api.  Try mdlRefFile_getParameters (buffer, REFERENCE_FILENAME, modelRef).

    You can still delve into the attachment struct using this...

    #include <msreffil.fdf>
    ReferenceFile* info = mdlRefFile_getInfo (modelRef);

     
    Regards, Jon Summers
    LA Solutions

    Answer Verified By: KarstenEvans 

  • Hi Jon,

    Thanks for the reply.   PDS still runs on MS/J  so I have to keep it compliant to MS/J...  

    Thanks for the tip. It's been a while since I have done any mdl and I skipped MS/J.

    Only tweaked a few old mdls in V8/2004 really.

    I just need to extract the reference file name independent of whether the reference file has been attached using variables, or browsing with it's file path stored.

    That's the main problem/bug using the .ma compiled in MSSE with MS/J.

    Even when I compile it for V8i it will still have to be for MS/J files in dgn7mode or perhaps converted to V8.

    DesignReview/SmartPlantReview  DGN/DRV models are highly unlikely to be native V8.

    FYI

    It uses Intergraph's version of PERL on NT or rather pink perl called PDSPERL.EXE to search DRV text label files  for items matching a selected DRV attribute.

    Then it hilites the matched PDS items in the relevant DGNs.

    So a PDS/Microstation user can select a pipe line id and hilite all PDS graphics with a line id attribute that matches.

    Back in '96/7 it was rather useful and it worked perfectly in MSSE.

    Quite a few Oil & Gas companies used it but Bentley never added it to the mdlfreewareapps.

    I was thinking of adding an About Me dialog showing my photo and link to my LinkedIn.

    Do you know of any example mdls that do some thing like that?

    I prefer the tinker/cut and paste method to long winded research/reading of help.

  • I'm confused about what you want to do, but I interpret your question like this:

    • You have many V7 DGN files
    • You attach those V7 DGN files as references to MicroStation V8
    • You want to extract the attachment path of each reference using MDL with MicroStation V8

    MDL for V8 should let you do what you want.

     
    Regards, Jon Summers
    LA Solutions

  • Hi Jon,

    didn't see your second reply.

    In MSSE I wrote a PDSLabel.ma   so microstation users could read Intergraph DesignReview labels.

    It was very useful for PDS users too as a Piper could read structural, electrical and HVAC labels.

    Bacically a dialog with a listbox that took selected row , added it to paste buffer and then ran PERL scripts with the selected text as argument.

    Anyways I didn't compile it for MS/J and PDS  evolved to run on MS/J.

    The mdl still ran but due to changes in ref files the path the mdl  was reading from the refFileP struct  was corrupted in MS/J.

    PDS STILL runs on MS/J and is still very much alive. So that means MS/J is still alive too.

    Anyways I found a full copy of the source and changed the MS/J DLOGDEMO example make file to suit.

    I used the old MSSE DLOGDEMO originally back in '97.

    It works now, but I was thinking of recompiling it in V8.  

    I was going to pass NULL for the model, but have read you post about the manuals being slightly out of date.

    I was thinking of adding my photo as part of the 'About' section of the help.

    I remember InfoSnap did that.

    Do you have any advice on the best/easiest way to display an photo  in a Dialog?

    Is there an example that shows how to display an image.

    Wasn't there a preview.ma once?

    I work in a Select company but it's german and users aren't allowed Select usernames.

    Last SDK I download was V8i SS1

    I am looking for a way that would work in MS/J and V8i.

    FYI this is a DRV file it uses DMRS, ASID links etc

    pds_file_type{1 00}

    lbl{0 3 102 1512 text {

    CMP NO/Mod Code:SNG1L001/E90

    Remark:

    MTO Reqt:Reportable by MTO

    Fab Cat:Contractor supplied, field fabricated

    NPD:1" 1"

    Prep:SWE SWE

    Rating:CL3000 CL3000

    Sch/thk:NREQD NREQD

    Open action:

    Chain lgth/bend angle:90 mm/deg

    P&ID Line no: 261-AP-931-1"-EC12AB-NI0mm

    Line/Iso ID: E1261-261-AP931A

    Stress run ID:

    Approval Status: Not approved/Not held

    Heat tracing: NONE

    Insulation: -NI0mm

    Unit_Fluid_Sequence: 261-AP-931

    }}

    lbl{0 5 89 1512 text {

    CMP NO/Mod Code:PSH2060B/PIPE

    Remark:

    MTO Reqt:Reportable by MTO

    Fab Cat:Contractor supplied, field fabricated

    NPD:1" 1"

    Prep:PE PE

    Sch/thk:S-XS S-XS

    Pipe Length:9374.97

    P&ID Line no: 261-AP-931-1"-EC12AB-NI0mm

    Line/Iso ID: E1261-261-AP931A

    Stress run ID:

    Approval Status: Not approved/Not held

    Heat tracing: NONE

    Insulation: -NI0mm

    Unit_Fluid_Sequence: 261-AP-931

    }}

    lbl{0 3 109 1512 text {

    CMP NO/Mod Code:SNG1L001/E90

    Remark:

    MTO Reqt:Reportable by MTO

    Fab Cat:Contractor supplied, field fabricated

    NPD:1" 1"

    Prep:SWE SWE

    Rating:CL3000 CL3000

    Sch/thk:NREQD NREQD

    Open action:

    Chain lgth/bend angle:90 mm/deg

    P&ID Line no: 261-AP-931-1"-EC12AB-NI0mm

    Line/Iso ID: E1261-261-AP931A

    Stress run ID:

    Approval Status: Not approved/Not held

    Heat tracing: NONE

    Insulation: -NI0mm

    Unit_Fluid_Sequence: 261-AP-931

    }}

    Bentley did create something similar to PDSLabel in V8 2004 but it converted all the DRV labels to TAGS

    and was flaky.

    I was going to add to PDSLabel so that people could actually add DRV labels into a .LBL file.

    The DGN/DRV model is sort of a existing standard for transferring model data from PDS <>PDMS <> SP3D.

    It is the simpliest way to transfer graphics with text data.

    It's old, but it works.

  • Unknown said:
    Do you have any advice on the best/easiest way to display an photo  in a Dialog?

    You need a generic item with a hook function.

    The hook function reads the image file at _CREATE time and displays it.  There was an MDL example that showed how that worked.  Here's a version of that, which works for me.  Note its use of the sole member of the mdlDither_api...

    /* ---------------------------------------------------------------------+
    |                                                                       |
    |    function name:    hookItem_GenericLogo                             |
    |                                                                       |
    |    events handled:    _INIT, _DRAW                                    |
    |                                                                       |
    |    description:    Loads a bit-map into a generic item                |
    |                                                                       |
    +--------------------------------------------------------------------- */
    Private void        hookItem_GenericLogo
    (
    DialogItemMessage    *dimP
    )
    {
        dimP->msgUnderstood = TRUE;

        switch (dimP->messageType)
        {
              case DITEM_MESSAGE_INIT:
            {
                char            fullFileSpec [MAXFILELENGTH];
                byte            *rgbBufferP    = NULL;
                Point2d            itemSize;
                DialogItem        *diP = dimP->dialogItemP;

                   dimP->u.init.initFailed = TRUE;

                mdlFile_buildName (fullFileSpec, NULL, szLoadPath, "karsten.bmp", NULL);
                if (SUCCESS != mdlFile_find (fullFileSpec, fullFileSpec, NULL, NULL)) {
                    // ("hookItem_GenericLogo: problem with image: %s", fullFileSpec);
                    break;
                }

                itemSize.x = diP->rect.corner.x - diP->rect.origin.x + 1;
                itemSize.y = diP->rect.corner.y - diP->rect.origin.y + 1;
                if (SUCCESS == mdlImage_readFileToRGB (&rgbBufferP, NULL,
                    fullFileSpec, IMAGEFILE_BMP, &itemSize, NULL)) {
                    mdlDialog_userDataPtrSet (dimP->db, rgbBufferP);
                       dimP->u.init.initFailed = FALSE;
                }
                break;
            }
              case DITEM_MESSAGE_DRAW:
            {
                int             i, rowLength;
                byte            *redP, *greenP, *blueP;
                DialogItem      *diP = dimP->dialogItemP;

                if (redP = mdlDialog_userDataPtrGet (dimP->db)) {
                    rowLength = diP->rect.corner.x - diP->rect.origin.x + 1;
                    greenP = redP  + rowLength;
                    blueP  = greenP + rowLength;

                    for (i = diP->rect.origin.y; i <= diP->rect.corner.y; i++) {
                        mdlDither_drawRow ((MSWindow*)dimP->db, diP->rect.origin.x,
                                                     diP->rect.corner.x, i,
                                                     redP, greenP, blueP);
                        redP   += 3 * rowLength;
                        greenP += 3 * rowLength;
                        blueP  += 3 * rowLength;
                    }
                }

                mdlDialog_rectDrawEdge (dimP->db, &diP->rect, TRUE);
                break;
            }
            case DITEM_MESSAGE_DESTROY:
            {
                byte    *tempBufferP    = NULL;

                if (tempBufferP = mdlDialog_userDataPtrGet (dimP->db))
                    free (tempBufferP);
                break;
            }
              default:
                dimP->msgUnderstood = FALSE;
                break;
        }
    }


     
    Regards, Jon Summers
    LA Solutions

    Answer Verified By: KarstenEvans 

  • Karsten,

    could you please divide your questions into several threads ! While you might find a number of people here, that can help you with references in V8 (and some of those thing should work in MS/J too), I doubtly fear that you will not find lots of people understanding your PDS problem(s). It even helps to concentrate on one problem not to mix it up with others.

    One thing I definitively could tell you, is that using NULL for any model is the worst idea that you may have. This was still supported in MS/J (as you had only 1 model per file) but even not recommended there, and will never work in any V8 version.

    With the changes to (multi-)models in V8 it becomes more important to go away from previous C standards where anything was (fastly) defined as NULL. I started programming with MS/J and I think I can remember that I still used the mdlReference_ functions and did not deal with any obvious structures. Unfortunately (for you) I stopped development for MS/J around 2004 when there was no longer a need to stay at this old stuff at our customers, and this might be true for most people out there, except those still dealing with PDS. From my point of view (not knowing which discrepancies might influence this decision) Intergraph made a mistake by stopping all further development on a V8 base.

    Michael



  • H Michael,

    I have written MDLs in V8 2004 and V8i so I do know about the file changes etc.

    I was agreeing with Jon about his comment that the help should be updated.

    It still says that NULL can be passed, when like Jon states parsing NULL is a bad idea.

    You might not remember the footprints painted on the pavement from the first MUG to the IGUG back in '94?.

    Ask the bros.. they might admit something now. :-P

    I think Intergraph decided to drop Microstation as a development base when Intergraph Microstation became Bentley Microstation, so way back in time ('94/95) and  has more to do with stubborn personalities within Intergraph.

    Smartplant 3D runs on the Jupiter 3D library instead of the old MicroCsl microstation libraries that PDS uses.

    V8 dropped MicroCsl, so it was more a case of Bentley blocking Intergraph from porting PDS to V8.

    If you look at market share of SP3D and Plantspace I think it is not accurate to say Intergraph made a big mistake.

    More a slight 'booboo'.  Intergraph is taking back the market share they did lose at end of 90's.

    I personally thought 3DM/Plantspace was much better that PDS but the best tool is not often used when a more familiar one is available.

    I gather Bentley still support MS/J because of big customers using Intergraph applications like PDS.

    Customers like Bechtel, FosterWheeler, etc.

    The main reason for me breathing life into an old MSSE mdl from '97 is because of requests from MS/J users.

    I know this is a programming forum, but forums are not just technical or at least they never were.

    Humour and chit chat make  it fun to follow a forum.

    BTW Jon I found some other posts you answered about images and generic items.

    back in comp.cad.microstation

    ah the good old days.. :-P

  • Karsten,

    my intention was only to get those (meanwhile 3) different themes (references, generic items, PDS) separated. As no one interested in generic items will search in a thread named "...concerning the old refFileP... ", and it is difficult to follow such a thread.

    Nevermind, I even prefer an informal style here.

    btw something from the examples I learned mdl programming from:

    for ( slot = 0; slot < ( tcb->maxRefs-1 ); ++slot )
     {
     if ( mdlRefFile_getParameters ( &active,
             REFERENCE_SLOTACTIVE,
             slot ) == SUCCESS )
      {
      /* print slot numbers of active reference files */
      if ( active == TRUE )
       {
       status = mdlRefFile_getParameters ( fileName,
                REFERENCE_FILENAME,
                slot );
       status = mdlRefFile_getParameters ( logicalName,
                REFERENCE_LOGICAL,
                slot );
       ggroup = drawComp_refGraphicGroup (slot);

             sprintf ( outString, "%d\t %d\n", slot, ggroup );
       mdlDialog_dmsgsPrint (outString);


    //         sprintf ( outString, "%d\t %s\t %s\t %ld\n", slot, fileName,
    logicalName, ggroup );
    //   mdlDialog_dmsgsPrint (outString);

       ++numslots;
       }
      }
     }

    Hope this helps for the original question

    Michael



  • Hi Karsten,

    Can you please share the PDSLabel.ma. We are using the latest bentley connect, though. Even the old version source could be of help.