Jump to content

Recommended Posts

Posted

In the case of Clint’s post, I don’t know that BricsCAD has ODBX

  • Like 1
Posted

Indeed it does! I had tried to get implement this in Python, but there was no public interface, same with the other clones. I wonder if it’s hidden in lisp?

  • Like 1
Posted

Does this work in BricsCAD?

 

I did a quick search before starting on this method and it showed ODBX in BricsCAD for a few versions back, but wasn't 100% sure.

 

The OP used AutoCAD 2021 when this thread was started and I only have AutoCAD to test with, so it is what it is.

 

This program might could be made a little faster and cleaner, though plenty fast enough for me.

 

I made some headway yesterday on doing the multi-file batch convertor, I may have to do some work they pay me to do today, though.

 

I am still waiting on the answers from my latest Request for Information, I might be able to do some more testing until then.

 

I'm positive they will respond and ask for finished drawings 5 minutes later.

 

I will probably continue this on my original thread I created for the older convertors.

 

Drawing Batch Converters - AutoLISP, Visual LISP & DCL - AutoCAD Forums

Posted

I just had AI write a test to see if ODBX worked.

 

(defun c:TestDbx ( / dbxProgId dbxDoc extFile)
  (vl-load-com)
  
  (if (vl-string-search "BricsCAD" (getvar "PROGRAM"))
    (setq dbxProgId "ObjectDBX.AxDbDocument")
    (setq dbxProgId (strcat "ObjectDBX.AxDbDocument." (substr (getvar "ACADVER") 1 2)))
  )
  
  (setq dbxDoc (vl-catch-all-apply 'vla-GetInterfaceObject 
                 (list (vlax-get-acad-object) dbxProgId)))
  
  (if (vl-catch-all-error-p dbxDoc)
    (progn
      (princ (strcat "\nError: Could not load interface using ProgID: " dbxProgId))
      (princ (strcat "\nDetails: " (vl-catch-all-error-message dbxDoc)))
    )
    (progn
      (setq extFile (getfiled "Select Drawing to Read" "" "dwg" 0))
      
      (if extFile
        (progn
          (vla-open dbxDoc extFile)
          (princ (strcat "\nSuccess! Total objects in Model Space: " 
                         (itoa (vla-get-count (vla-get-modelspace dbxDoc)))))
        )
        (princ "\nNo file selected.")
      )
      (vlax-release-object dbxDoc)
    )
  )
  (princ)
)

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...