Developed myself into a corner.

Discussion in 'AutoCAD' started by blammo, May 4, 2004.

  1. blammo

    blammo Guest

    Oh no,

    Ummm, as the title suggests, I seem to have developed myself into a corner.

    The situation:

    I have some code that retrieve a JPEG from a WebService (MapSERVER
    based). The idea was to capture the current screen resolution in
    AutoCAD and grab the approriate resolution of imagery from MapSERVER and
    display it inside of AutoCAD simply by being zoomed into the approriate
    level. This all works just peachy until we try to pull another image in
    from the same service. It seems that IE like to use the same name for
    the new file (jpeg image) as it did for the previous when it comes from
    a CGI on the server.

    The Problem:

    The newly downloaded file (jpeg) has the same name and cache (folder)
    location locally as the first one did.

    The Question:

    How can the IMAGE insertion name be changed/modified (similar to a BLOCK
    rename) upon insertion into the DWG if at all. I run a similar
    procedure for DWG tiles from the server where I rename the block upon
    insertion. There doesn't seem to be a way of redefining the image name
    other than renaming the source file before using IMAGEATTACH on it.

    A couple of possible solutions:

    I though about, might be in how the Web Service send the image down,
    if I can somehow force the imageName on the file sent and have IE read
    it faithfully, that woulddo the trick. Another option might be to
    generate the image on the server and place it in a TMP location for
    forwarding by the Server CGI, IE seems to like this approach as it
    renames the local cached object accordingly.

    Any ideas greatly appreciated.

    Thanks

    bobb
     
    blammo, May 4, 2004
    #1
  2. blammo

    mataeux Guest

    what you did sounds great, did you ever look into OLE objects? it may not be
    preferable but that way you could embed the image in the drawing.
     
    mataeux, May 5, 2004
    #2
  3. blammo

    John Uhden Guest

    I don't know about the literal meaning of "upon insertion." but just like an
    xref, you can change the both the name and path of an image reference (Raster
    object) using the Name and ImageFile properties via ActiveX
     
    John Uhden, May 5, 2004
    #3
  4. blammo

    Mike Weaver Guest

    Thus:
    (setq ent(car (entsel)))
    <Entity name: 7ef80ef8>
    (vla-put-name (vlax-ename->vla-object ent) "NewName")

    However, I think it will take a pathname change as well.

    I suspect the easy solution (hopefully for you - not for me) would be to put
    the images on the drive with unique names in the first place.

    Just my 2 cents.

    Mike Weaver
     
    Mike Weaver, May 5, 2004
    #4
  5. blammo

    blammo Guest

    That would all be new to me, ActiveX. Not sure if I'm ready for
    (really) new stuff yet.

    the Upon insertion was meant to relate to the start up of the
    IMAGEATTACH command, while in the command, how would one change the name
    of the source object (IMAGE) for placement inside of AutoCAD. THe name
    is the same from the current Window File pointer, even though the images
    change.

    They are dynamically generated on the server via a CGI call.

    bobb
     
    blammo, May 7, 2004
    #5
  6. blammo

    blammo Guest

    Well that's another new one. And you say this works for any insertion
    even and IMAGE object?
    I had though about copying the file to a new name locally, but that
    didn't seem very clean, and IE cleans it's own cache out, so it would be
    preferable to leaqve the files there.
    That's the rub here. The images are being generated on the fly from a
    web based image server, these (aerial) photo's are being called by IE
    via a WEB CGI call. IE like to store the result locally by the same
    name, despite the image data changing, it understands the CGI call as a
    file name, which is the same everytime. in other words, everything after
    the CGI, all the parameters for generating the seperate images, are
    ignored by IE and it uses the same name/location locally to store the
    new download, which conflicts with any other previously downloaded and
    IMAGEATTACHED raster file in AutoCAD.
    I'm still pondering this if anyone has any ideas.

    TIA

    bobb
     
    blammo, May 7, 2004
    #6
  7. blammo

    mataeux Guest

    have you thought about making an OLE object?
    they are created with the INSERTOBJ command but can also be created with
    basic autolisp.
    to create an OLE object would not require the source image, it embeds the
    data into the drawing.
    of course your drawing files would be larger. as i said, it may not be
    preferable.
     
    mataeux, May 7, 2004
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.