Author Topic: Problem with OBJECTDBX and locked files.  (Read 4610 times)

0 Members and 1 Guest are viewing this topic.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Problem with OBJECTDBX and locked files.
« on: February 06, 2014, 04:19:00 AM »
I am running into an issue with OBJECTDBX and locked drawings (because they are opened by a different user or in another instance of BricsCAD).

My problem is that:
Code: [Select]
(vla-open odbxObject fileName)Does not produce an error. Which seems strange to me. Maybe this is a BricsCAD issue?
And:
Code: [Select]
(= (strcase (vla-get-name odbxObject)) fileName)Returns T.

But the locked drawing has in fact not been opened. The limits are wrong and only layer "0" exists. Apart from the name it seems that the open drawing is the ODBX 'default' drawing.

How can I avoid this confusing situation?

Bhull1985

  • Guest
Re: Problem with OBJECTDBX and locked files.
« Reply #1 on: February 06, 2014, 07:25:47 AM »
AutoCAD uses the DWL file extension to handle all of this, what's brisCADs alternate version of this system?
If there's nothing......pretty huge oversight.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Problem with OBJECTDBX and locked files.
« Reply #2 on: February 06, 2014, 08:38:12 AM »
To clarify: You cannot open a locked file in BricsCAD for editing. I don't know how this is accomplished but I am unaware of .dwl files. And as I have mentioned in my first post: The locked file is in fact not opened, it only appears that way.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Problem with OBJECTDBX and locked files.
« Reply #3 on: February 06, 2014, 08:56:46 AM »
A workaround to check for this issue:
Code: [Select]
(/= (vla-get-lastsavedby (vla-get-summaryinfo odbxObject)) "")Not very reliable as you can use (vla-set-lastsavedby).

Bhull1985

  • Guest
Re: Problem with OBJECTDBX and locked files.
« Reply #4 on: February 06, 2014, 09:20:01 AM »
(because they are opened by a different user or in another instance of BricsCAD).

But the locked drawing has in fact not been opened.

Not trying to be a pain but I think that's somewhat contradictory with what your latest post said.
Autodesk does the DWL method to make sure that you cannot rename a file that's in use or whatnot.
Also it's easy to tell who's working on what if you track these dwl files

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1454
  • Marco
Re: Problem with OBJECTDBX and locked files.
« Reply #5 on: February 06, 2014, 09:30:21 AM »
I am running into an issue with OBJECTDBX and locked drawings (because they are opened by a different user or in another instance of BricsCAD).

My problem is that:
Code: [Select]
(vla-open odbxObject fileName)Does not produce an error. Which seems strange to me. Maybe this is a BricsCAD issue?
And:
Code: [Select]
(= (strcase (vla-get-name odbxObject)) fileName)Returns T.

But the locked drawing has in fact not been opened. The limits are wrong and only layer "0" exists. Apart from the name it seems that the open drawing is the ODBX 'default' drawing.

How can I avoid this confusing situation?
Maybe:
(vl-catch-all-error-p (vl-catch-all-apply 'vla-Open (list odbxObject fileName)))

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Problem with OBJECTDBX and locked files.
« Reply #6 on: February 06, 2014, 09:38:26 AM »
@ Bhull1985:
I don't see any contradictions. Note: I am talking about opening a dwg using OBJECTDBX.

@ Marc'Antonio Alessi:
The problem is that there is no error to catch.

Bhull1985

  • Guest
Re: Problem with OBJECTDBX and locked files.
« Reply #7 on: February 06, 2014, 09:47:18 AM »
And as I have mentioned in my first post: The locked file is in fact not opened, it only appears that way.

Quote
"(because they are opened by a different user or in another instance of BricsCAD)."

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Problem with OBJECTDBX and locked files.
« Reply #8 on: February 06, 2014, 10:05:22 AM »
Pseudo code solution:

if file file can be opened for append:
    close file
    open via objectdbx
else:
    copy file to temp folder
    open via objectdbx
    flag in doc's dictionary as temp file copy
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Patrick_35

  • Guest
Re: Problem with OBJECTDBX and locked files.
« Reply #9 on: February 06, 2014, 10:24:12 AM »
Hi

Try this
Code: [Select]
(defun its_ok(file / dwg)
  (and (findfile file)
       (setq dwg (open file "a"))
    (not (close dwg))
  )
)

(its_ok "c:/test/drawing.dwg")

ps : Time to write and test the example and the response arrives

@+

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1454
  • Marco
Re: Problem with OBJECTDBX and locked files.
« Reply #10 on: February 06, 2014, 11:33:17 AM »
My tests with Bricscad V14 - DOSLib 9.0.1:
Code: [Select]
>>> File opened in Bricscad and NOT read only
: (DOS_FILE "C:\\Temp\\pippo.dwg")
("pippo.dwg" 350357 2.01402e+007 8)
: (DOS_OPENP "C:\\Temp\\pippo.dwg")
T
: (vl-file-systime "C:\\Temp\\pippo.dwg")
(2014 2 4 6 17 8 19 0)
: (its_ok "C:\\Temp\\pippo.dwg")
nil


>>> File read only and NOT opened in Bricscad
: (DOS_FILE "C:\\Temp\\pippo.dwg")
("pippo.dwg" 300352 2.01402e+007 9)
: (DOS_OPENP "C:\\Temp\\pippo.dwg")
nil
: (vl-file-systime "C:\\Temp\\pippo.dwg")
(2014 2 4 6 17 8 53 0)
: (its_ok "C:\\Temp\\pippo.dwg")
nil


>>> File read only NOT and NOT opened in Bricscad
: (its_ok "C:\\Temp\\pippo.dwg")
T

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Problem with OBJECTDBX and locked files.
« Reply #11 on: February 06, 2014, 11:46:18 AM »
@ Bhull1985:
OK:
"(because they have been opened by a different user or in another instance of BricsCAD)"
Would have been better linguistically.

@ MP and Patrick_35:
Thank you, that solution works.

@ Marc'Antonio Alessi:
The drawings in my tests are not read only if they have not been opened in BricsCAD.
« Last Edit: February 06, 2014, 11:49:50 AM by roy_043 »

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Problem with OBJECTDBX and locked files.
« Reply #12 on: February 28, 2014, 05:44:24 AM »
There was indeed a problem with BricsCAD. This has been fixed in version 14.2.06:
SR44023 - LISP: opening a locked or invalid drawing file did not trigger a Lisp error. Applications should use (vl-catch-all-apply) when using the "Open" method on an ObjectDbx object.

Lee Mac

  • Seagull
  • Posts: 12922
  • London, England
Re: Problem with OBJECTDBX and locked files.
« Reply #13 on: February 28, 2014, 06:22:51 PM »
There was indeed a problem with BricsCAD. This has been fixed in version 14.2.06:
SR44023 - LISP: opening a locked or invalid drawing file did not trigger a Lisp error. Applications should use (vl-catch-all-apply) when using the "Open" method on an ObjectDbx object.

The BricsCAD support never ceases to amaze me  8-)

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Problem with OBJECTDBX and locked files.
« Reply #14 on: March 02, 2014, 05:46:37 AM »
The BricsCAD support never ceases to amaze me  8-)
1+
BricsCAD support is exemplary.
« Last Edit: March 02, 2014, 05:49:52 AM by roy_043 »

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1454
  • Marco
Re: Problem with OBJECTDBX and locked files.
« Reply #15 on: March 02, 2014, 08:26:49 AM »
There was indeed a problem with BricsCAD. This has been fixed in version 14.2.06:
SR44023 - LISP: opening a locked or invalid drawing file did not trigger a Lisp error. Applications should use (vl-catch-all-apply) when using the "Open" method on an ObjectDbx object.

The BricsCAD support never ceases to amaze me  8)
1+