Message 1 of 3
attachxref bug?

Not applicable
07-06-2006
05:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm using AutoCAD 2006, and have written a routine to copy an xref from one drawing to another maintaining layer properties.
There seems to be a glitch in the attachexternalreference method, whereby the angle isn't being set correctly. The code I have is:
Set NewXref = DestinationDrawing.ModelSpace.AttachExternalReference(SourceXref.Path, SourceXref.Name, SourceXref.InsertionPoint, SourceXref.XScaleFactor, SourceXref.YScaleFactor, SourceXref.ZScaleFactor, SourceXref.Rotation, True)
This basically overlays a newxref object using the parameters of the original (source) xref object. The problem is that when either or both drawings have a UCS set, the destination xref doesn't inherit the WCS insertion point and rotation of the source xref.
If I follow this attach line with the following, then the new xref is repositioned correctly, despite apparently doing the same thing as the attach line:
NewXref.InsertionPoint = SourceXref.InsertionPoint
NewXref.Rotation = SourceXref.Rotation
Does anyone know why this is the case? The help file states that insertion point is a 3D WCS point, and that rotation is an angle relative to the objects WCS X axis. Insertion point sounds self explanatory and should just work, although I'm not sure what 'objects WCS' implies.
There seems to be a glitch in the attachexternalreference method, whereby the angle isn't being set correctly. The code I have is:
Set NewXref = DestinationDrawing.ModelSpace.AttachExternalReference(SourceXref.Path, SourceXref.Name, SourceXref.InsertionPoint, SourceXref.XScaleFactor, SourceXref.YScaleFactor, SourceXref.ZScaleFactor, SourceXref.Rotation, True)
This basically overlays a newxref object using the parameters of the original (source) xref object. The problem is that when either or both drawings have a UCS set, the destination xref doesn't inherit the WCS insertion point and rotation of the source xref.
If I follow this attach line with the following, then the new xref is repositioned correctly, despite apparently doing the same thing as the attach line:
NewXref.InsertionPoint = SourceXref.InsertionPoint
NewXref.Rotation = SourceXref.Rotation
Does anyone know why this is the case? The help file states that insertion point is a 3D WCS point, and that rotation is an angle relative to the objects WCS X axis. Insertion point sounds self explanatory and should just work, although I'm not sure what 'objects WCS' implies.