Topic
  • 10 replies
  • Latest Post - ‏2013-05-14T14:39:09Z by sadoug
Bob_Swan
Bob_Swan
36 Posts

Pinned topic Change from view OLE as icon

‏2009-10-29T14:51:38Z |
How, using dxl, do I change an OLE displayed as an icon to one displayed as editable information?

Manually I would select Edit>Ole Object Properties>View>display as editable information.
As my document has a large number of OLE (>50) I want to automate it.
Running with DOORS 8.3 on windows XP.
I thought I had seen this somewhere, maybe as 'undocumented facility', but can't find it.
Updated on 2013-03-28T18:41:58Z at 2013-03-28T18:41:58Z by llandale
  • kbmurphy
    kbmurphy
    160 Posts

    Re: Change from view OLE as icon

    ‏2009-10-29T16:27:21Z  
    I wonder if there is a way to do this too.

    I did notice that you could select the object in DXL and call the OLE Properties dialog. My guess is that the DXL would stop there and wait for you to click OK on the window. That would make it a little less painful...have you tried that?
  • driven_mad
    driven_mad
    3 Posts

    Re: Change from view OLE as icon

    ‏2010-02-24T02:46:49Z  
    did this get solved? i'm trying to do the same thing.
  • ESvl
    ESvl
    3 Posts

    Re: Change from view OLE as icon

    ‏2012-07-06T13:41:45Z  
    did this get solved? i'm trying to do the same thing.
    Me as well... :/
  • jenksbj
    jenksbj
    2 Posts

    Re: Change from view OLE as icon

    ‏2013-03-21T14:43:59Z  
    I realize this is an old thread but has anyone come up with a solution to this issue? If so, I would be very interested in some sample code.
  • Tony_Goodman
    Tony_Goodman
    270 Posts

    Re: Change from view OLE as icon

    ‏2013-03-21T15:00:10Z  
    • jenksbj
    • ‏2013-03-21T14:43:59Z
    I realize this is an old thread but has anyone come up with a solution to this issue? If so, I would be very interested in some sample code.
    I am afraid this cannot be achived with DXL.

    The OLE Object Properties dialog is invoked by a built-in perm showOlePropertiesDialog(Object).

    This dialog is not implemented in DXL.

    Tony Goodman, www.smartdxl.com
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Change from view OLE as icon

    ‏2013-03-26T12:58:24Z  
    I am afraid this cannot be achived with DXL.

    The OLE Object Properties dialog is invoked by a built-in perm showOlePropertiesDialog(Object).

    This dialog is not implemented in DXL.

    Tony Goodman, www.smartdxl.com
    What if you were trying to do the opposite? Convert an OLE shown as editable information to an icon? Could "oleInsert" with the "insertAsIcon" parameter be used somehow to call the attribute of the current object that has the OLE and convert it to icon?

    I see from the DXL help this is for gettting a word doc and displaying as an ole, but I wonder if it could be tweaked to call an attribute instead of a file location?
  • Tony_Goodman
    Tony_Goodman
    270 Posts

    Re: Change from view OLE as icon

    ‏2013-03-28T13:08:00Z  
    What if you were trying to do the opposite? Convert an OLE shown as editable information to an icon? Could "oleInsert" with the "insertAsIcon" parameter be used somehow to call the attribute of the current object that has the OLE and convert it to icon?

    I see from the DXL help this is for gettting a word doc and displaying as an ole, but I wonder if it could be tweaked to call an attribute instead of a file location?

    Aha!
    I don't know why I didn't think of this before.
     

    Object o = current 
    string res = ""
     
    if (oleIsObject o)
    {
        if (oleCut o)
        {
     
                res = olePasteSpecial(o."Object Text", false)
            }
    }
     
    print res
    


    Be warned that I have only tested this on an object that contains a single OLE in the Object Text.

    Tony Goodman, www.smartdxl.com

    Updated on 2013-12-18T22:58:13Z at 2013-12-18T22:58:13Z by iron-man
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Change from view OLE as icon

    ‏2013-03-28T14:52:52Z  

    Aha!
    I don't know why I didn't think of this before.
     

    <pre class="javascript dw" data-editor-lang="js" data-pbcklang="javascript" dir="ltr">Object o = current string res = "" if (oleIsObject o) { if (oleCut o) { res = olePasteSpecial(o."Object Text", false) } } print res </pre>


    Be warned that I have only tested this on an object that contains a single OLE in the Object Text.

    Tony Goodman, www.smartdxl.com

    Tony

    I'm trying to get your code to loop through a module and update all objects but all I can get is the code to loop through and put the icons in the current object (if 5 objects with editable OLE's will convert to icons, but will cut/paste all 5 into current object) rather than their own respective objects. Please tell me what I'm missing.
     

    Object o
    Module m = current 
    string res = ""
     
    for o in m do {
    //check if object text has embedded OLE
    if (oleIsObject o) {
     
    //cut the OLE to the clipboard???
        if (oleCut o)
        { 
                //olePaste pastes the clipboard to object text of o as an embedded OLE
                //putting false to true changes it to an icon
                res = olePasteSpecial(o."Object Text", true)
            }
    }
     
    Thanks
    }
    
    Updated on 2013-12-18T22:59:00Z at 2013-12-18T22:59:00Z by iron-man
  • llandale
    llandale
    3035 Posts

    Re: Change from view OLE as icon

    ‏2013-03-28T18:41:58Z  

    Tony

    I'm trying to get your code to loop through a module and update all objects but all I can get is the code to loop through and put the icons in the current object (if 5 objects with editable OLE's will convert to icons, but will cut/paste all 5 into current object) rather than their own respective objects. Please tell me what I'm missing.
     

    <pre class="javascript dw" data-editor-lang="js" data-pbcklang="javascript" dir="ltr">Object o Module m = current string res = "" for o in m do { //check if object text has embedded OLE if (oleIsObject o) { //cut the OLE to the clipboard??? if (oleCut o) { //olePaste pastes the clipboard to object text of o as an embedded OLE //putting false to true changes it to an icon res = olePasteSpecial(o."Object Text", true) } } Thanks } </pre>

    Intuitive guess: olePaste uses the "current" object not the attrRef one.

    current = o
        if (o != current(m)) then cannot set current
        elseif (oleCut o)
        { 
                //olePaste pastes the clipboard to object text of o as an embedded OLE
                //putting false to true changes it to an icon
                res = olePasteSpecial(o."Object Text", true)
            }
    


    Tested this pasting into some other attr and it work for that attr; but yes in the "current" object.

    I find it odd that it it can turn an "attrRef" into a different one based on the current Object.

    -Louie

    Like my Daddy used to say when I'd go visit him; "To deal with crazy folks you have to think like crazy folks."

    Updated on 2013-12-18T22:59:48Z at 2013-12-18T22:59:48Z by iron-man
  • sadoug
    sadoug
    3 Posts

    Re: Change from view OLE as icon

    ‏2013-05-14T14:39:09Z  
    • llandale
    • ‏2013-03-28T18:41:58Z

    Intuitive guess: olePaste uses the "current" object not the attrRef one.

    <pre class="javascript dw" data-editor-lang="js" data-pbcklang="javascript" dir="ltr">current = o if (o != current(m)) then cannot set current elseif (oleCut o) { //olePaste pastes the clipboard to object text of o as an embedded OLE //putting false to true changes it to an icon res = olePasteSpecial(o."Object Text", true) } </pre>


    Tested this pasting into some other attr and it work for that attr; but yes in the "current" object.

    I find it odd that it it can turn an "attrRef" into a different one based on the current Object.

    -Louie

    Like my Daddy used to say when I'd go visit him; "To deal with crazy folks you have to think like crazy folks."

     

    The use of current can fix the problem ...

     

    pragma runLim, 10000
     
    Module m=current
    Object o
    string res = ""   
     
    for o in m do {
    current = o

    if (oleIsObject o) 

     
    if (oleCut o) 
    {   res = olePasteSpecial(o."Object Text", true) 
    }   
    print res
    }

     

    Greg

    Updated on 2013-05-14T14:57:54Z at 2013-05-14T14:57:54Z by sadoug