Message 1 of 4
Nested Copy
Not applicable
04-01-2004
11:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I wanted to write my own nested copy command in VBA that is like the NCOPY Express Tool except does not prompt for base and displacement points. (I also find NCOPY to be slow) I thought it would be quite simple but it doesn't seem to be simple enough for me. I can get a subentity a tell if it is nested one level down from a Block or XREF but can't work out how to copy it into modelspace. Any help will be greatly appreciated. This code is as far as I got:
----------
Option Explicit
Public Sub test()
Dim objEnt As AcadEntity
Dim varPickedPoint As Variant
Dim varTransMatrix As Variant
Dim varContextData As Variant
Dim objEntParent As AcadEntity
On Error GoTo ErrorHandler
ThisDrawing.Utility.GetSubEntity objEnt, varPickedPoint, varTransMatrix, varContextData
On Error GoTo 0
If IsEmpty(varContextData) = False Then
If UBound(varContextData) = 0 Then
Set objEntParent = ThisDrawing.ObjectIdToObject(varContextData(0))
If TypeOf objEntParent Is AcadBlockReference Then
End If
End If
End If
Exit Sub
ErrorHandler:
Resume
End Sub
----------
Regards - Nathan
----------
Option Explicit
Public Sub test()
Dim objEnt As AcadEntity
Dim varPickedPoint As Variant
Dim varTransMatrix As Variant
Dim varContextData As Variant
Dim objEntParent As AcadEntity
On Error GoTo ErrorHandler
ThisDrawing.Utility.GetSubEntity objEnt, varPickedPoint, varTransMatrix, varContextData
On Error GoTo 0
If IsEmpty(varContextData) = False Then
If UBound(varContextData) = 0 Then
Set objEntParent = ThisDrawing.ObjectIdToObject(varContextData(0))
If TypeOf objEntParent Is AcadBlockReference Then
End If
End If
End If
Exit Sub
ErrorHandler:
Resume
End Sub
----------
Regards - Nathan