zitronet Posted February 8, 2012 Share Posted February 8, 2012 I have AutoCAD drawings that have xrefs attached as an attachment. I would like to change it to Overlay using a lisp routine. Does anyone know of a command I can insert into a lisp routine to change the attachment type of attached xrefs from Attachment to Overlay? Thanks in advance for you help. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted February 8, 2012 Share Posted February 8, 2012 Welcome to CADTutor! Perhaps there's a more effective way of accomplishing this, but I know you can use the vla-AttachExternalReference Method, and specify the bOverlay Parameter as :vlax-True. From the Developer Documentation: AttachExternalReference Method Attaches an external reference (xref) to the drawing. Signature RetVal = object.AttachExternalReference (PathName, Name, InsertionPoint, XScale, YScale, ZScale, Rotation, bOverlay [, Password]) Object ModelSpace Collection, PaperSpace Collection, Block The objects this method applies to. PathName String; input-only The full path and file name of the drawing to be referenced. Name String; input-only The name for the xref to be created. InsertionPoint Variant (three-element array of Doubles); input-only The 3D WCS coodinates specifying the point at which an ExternalReference instance is inserted into the drawing. The insertion point in the current drawing is aligned with the point defined by the BASE system variable in the referenced file. XScale Double; input-only The X scaling factor for the xref instance. YScale Double; input-only The Y scaling factor for the xref instance. ZScale Double; input-only The Z scaling factor for the xref instance. Rotation Double; input-only The rotation angle for the xref instance. This angle is specified in radians. bOverlay Boolean; input-only TRUE: The xref instance is an overlay. FALSE: The xref instance is an attachment. Password Variant; input-only; optional RetVal ExternalReference object The newly created ExternalReference object. Remarks Like Block objects, attached ExternalReference objects can be nested. If another person is editing the drawing to be referenced, the drawing attached is based on the most recently saved version. If the referenced file is missing or corrupt, its data is not displayed in the current drawing. Quote Link to comment Share on other sites More sharing options...
zitronet Posted February 8, 2012 Author Share Posted February 8, 2012 Thanks RenderMan. That was very helpful! Quote Link to comment Share on other sites More sharing options...
BlackBox Posted February 9, 2012 Share Posted February 9, 2012 You're welcome. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.