Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Saving in ObjectDBX

  1. #1
    I could stop if I wanted to
    Join Date
    2003-05
    Posts
    335
    Login to Give a bone
    0

    Default Saving in ObjectDBX

    I am having trouble changing a text object and then saving it in a file using ObjectDBX. Can someone shed any light on this for me. It seems to open and close the file properly because it losses the file preview, but it doesn't maintain the change to the text object.

    I am working in ADT2005 on XP Pro.

    Someone please help,

  2. #2
    I could stop if I wanted to msretenovic's Avatar
    Join Date
    2002-02
    Location
    Galloway, Oh
    Posts
    305
    Login to Give a bone
    0

    Default Re: Saving in ObjectDBX

    Try using (vla-saveas dbxDoc dwgName nil). I've been using this and it works well .


    dbxDoc is the open drawing.
    dwgName is the name and path to save it to.
    the last argument will let you specify which file format to use (though I'm having a little trouble with it in 2004 ).

    HTH,

  3. #3
    I could stop if I wanted to
    Join Date
    2003-05
    Posts
    335
    Login to Give a bone
    0

    Default Re: Saving in ObjectDBX

    Mike,

    Opening and closing I get right, and even deleting objects, but getting it to keep changes to a text object is different.

    I'm missing something.

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,396
    Login to Give a bone
    0

    Default Re: Saving in ObjectDBX

    The Save method is broken in ObjectDbx, it doesn't work. You have to use SaveAs. Unless there's something wrong with your code that modifies the text. Maybe you need to show it.
    C:> ED WORKING....

  5. #5
    I could stop if I wanted to
    Join Date
    2003-05
    Posts
    335
    Login to Give a bone
    0

    Default Re: Saving in ObjectDBX

    Saveas works for me. It's just the code the changes the text object that is messed up.

    txtobj = Object for the text item
    news = new text string
    olds = old text string

    (defun fandr (txtobj)
    (vl-string-subst news olds (vla-get-textstring txtobj))
    )

    thanks,

  6. #6
    100 Club matt.worland's Avatar
    Join Date
    2015-12
    Location
    Denver, CO USA
    Posts
    174
    Login to Give a bone
    0

    Default Re: Saving in ObjectDBX

    Could it be that your two strings are different cases?

  7. #7
    I could stop if I wanted to
    Join Date
    2003-05
    Posts
    335
    Login to Give a bone
    0

    Default Re: Saving in ObjectDBX

    no the strings are the same case. I used a test drawing with strings that I set up with different cases to see which would work. When I step thru the code it shows the string changing, but for some reason never gets saved back to the dwg. Could it be as simple as saving to a variable.

  8. #8
    I could stop if I wanted to msretenovic's Avatar
    Join Date
    2002-02
    Location
    Galloway, Oh
    Posts
    305
    Login to Give a bone
    0

    Lightbulb Re: Saving in ObjectDBX

    Are you using a vla-put-string anywhere . Because vl-string-subst will only replace the pattern but will not place it in the text object.

    (setq string (vla-get-textString txtObj))
    (setq string (vl-string-substr news olds string))
    (vla-put-textString txtObj)

    Where txtObj is your text object.

    HTH

  9. #9
    I could stop if I wanted to
    Join Date
    2003-05
    Posts
    335
    Login to Give a bone
    0

    Default Re: Saving in ObjectDBX

    dddduuuuuuhhhhhhhhhhh!!!!!!!!!!!!!!!!!

    Thanks Mike. Sometimes I feel like a total idiot.
    It works now. Imagine that.

  10. #10
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Exclamation Re: Saving in ObjectDBX

    Quote Originally Posted by msretenovic
    Try using (vla-saveas dbxDoc dwgName nil). I've been using this and it works well.

    dbxDoc is the open drawing.
    dwgName is the name and path to save it to.
    the last argument will let you specify which file format to use (though I'm having a little trouble with it in 2004
    Warning! Using (vla-SaveAs) is not the same as using the ObjectDBX version of SaveAs. See this post.

Page 1 of 2 12 LastLast

Similar Threads

  1. OBJECTDBX and VB
    By raj_thapar2003 in forum VBA/COM Interop
    Replies: 4
    Last Post: 2018-02-15, 01:36 PM
  2. Saving files with ObjectDBX
    By christian.montagnac in forum VBA/COM Interop
    Replies: 3
    Last Post: 2010-04-29, 07:48 PM
  3. C# and ObjectDBX?
    By KevinBarnett in forum Dot Net API
    Replies: 1
    Last Post: 2006-09-19, 06:09 AM
  4. ObjectDBX issue
    By mjsregister in forum VBA/COM Interop
    Replies: 2
    Last Post: 2004-11-09, 09:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •