Prepare drawings for sharing
I use sheetsets to create a set of several 2-D drawings. I use models, views, etc to layout things on the sheets.
I wish to transmit them with all sheetset fields converted to text and xrefs bound, so that each sheet is transmitted without needing external files for it's fidelity ie. each sheet is a .dwg file containing no xrefs or sheetset fields.
I did not see options in etransmit to accomplish this - could anyone enlighten me on how to get what I want?
Comments
-
Hello.
In Bricscad there is no tool to achieve the requested task.
Also, I couldn't find a third-party application to do that.Something that might be of interest, although it is not exactly what was requested, is the EXPORTLAYOUT command.
This works to export a specific layout in a drawing as a separate drawing.This approach works only with one layout at a time.
To speed up the process, there is a small plugin available with the next link.
0 -
Thanks - EXPORTLAYOUT is new to me, and is of interest although not exact. Unfortunately the command throws an error on my drawing and only populates one of my two viewports in the output file - suspecting a bricscad bug here:
Another workaround on that aspect of this task is via using
-xref
,Bind
I did not attempt the JTB world lisp, as my sheets only have a single layout per file, it looks like that routine walks through a file containing many layouts, saving each to a separate file which is not my case. For automation in a sheetset, such a thing would have to walk across multiple sheet files, for now, my projects are small enough that I could go one-by-one without too much angst.
0 -
Regarding the second part of the task, to nuke the sheetset fields, I found the following routine:
(vl-load-com) (defun c:FLD2TXT (/ ss n bn an ad s) (prompt "Select the objects you wish to remove the field links from: " ) ;_ end of prompt (setq ss (ssget '((0 . "INSERT,MTEXT,DIMENSION,TEXT,MULTILEADER")))) ;Get selection set from user (setq n 0) ;Initialize counter ;; Step through selection set one entity at a time (while (< n (sslength ss)) (setq bn (ssname ss n)) ;Get the nth entity in the selection set (setq ad (entget bn)) ;Get the entity's data (cond ((= "INSERT" (cdr (assoc 0 ad))) ;Check if block (setq an (entnext bn)) ;Get the next enity after bn ;; Step through each next entity until it is not an attribute (while (and an ;Check if entity is found (setq ad (entget an)) ;Get data (= "ATTRIB" (cdr (assoc 0 ad))) ;Check if attribute ) ;_ end of and (setq s (cdr (assoc 1 ad))) ;Get text value (entmod (list (assoc -1 ad) (cons 1 ""))) ;Modify the entity (entmod (list (assoc -1 ad) (cons 1 s))) ;Modify the entity (entupd an) ;Update screen to show change (setq an (entnext an)) ;Get next entity ) ;_ end of while ) ((= "MULTILEADER" (cdr (assoc 0 ad))) ;Check if block (setq ad (vlax-ename->vla-object bn) s (vla-get-TextString ad) ) (vla-put-TextString ad "") (vla-put-TextString ad s) ) ;; Anything else (t (setq s (cdr (assoc 1 ad))) ;Get text value (entmod (list (assoc -1 ad) (cons 1 ""))) ;Modify the entity (entmod (list (assoc -1 ad) (cons 1 s))) ;Modify the entity (entupd an) ;Update screen to show change ) ) (setq n (1+ n)) ;Increment counter ) ;_ end of while (setq ss nil) ;Clear selection set (gc) ;Clear unused memory (princ) ) ;_ end of defun
Source:
Although this routine seems to try to do what I want, the sad story is that it is apparently does not work in my bricscad. I was able to load it, but my attempts to point it at the fields in my drawings resulted in no apparent effect.
I was able to get the code into the bricscad lisp IDE via
VLIDE
. I was also able to run it in the debugger, incrementing the code step-by-step gave me some indications that it was following the expected execution paths with generally reasonable results - kind of seems like the entmod function may not be effective here, and I am out of ideas at the moment on how to get this to behave.0 -
If you’re feeling adventurous, you can use python
#link error #enum Acad::ErrorStatus __cdecl AcDbText::convertFieldToText(void)" import traceback from pyrx_imp import Ap, Db, Ed, Ge, Gi, Gs, Rx def PyRxCmd_doit() -> None: try: db = Db.curDb() #text and attribues txts = [Db.Text(id, Db.OpenMode.kForWrite) for id in db.objectIds(Db.Text.desc())] for txt in txts: if not txt.hasFields(): continue txt.setTextString(Db.Field(txt.getField()).getFieldCode(Db.FieldCodeFlag.kEvaluatedText)) #mtext mtxts = [Db.MText(id, Db.OpenMode.kForWrite) for id in db.objectIds(Db.MText.desc())] for txt in mtxts: if not txt.hasFields(): continue txt.setContents(Db.Field(txt.getField()).getFieldCode(Db.FieldCodeFlag.kEvaluatedText)) except Exception as err: traceback.print_exception(err)
0 -
Also, there’s a few functions for binding xrefs, I’ve not tested them, they are wrappers for acedXrefBind
def PyRxCmd_doit2() -> None: try: Ed.Core.xrefBind("XrefBlockname") except Exception as err: traceback.print_exception(err)
0