Message 1 of 2
Trim in VBA

Not applicable
11-08-2007
08:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Using Autocad 2006, I am sending a trim command to trim a polyline around two trim lines. The code looks like this:
ThisDrawing.SendCommand "trim (handent " & Chr(34) & trimline1.Handle & Chr(34) & ") (handent " & Chr(34) & trimline2.Handle & Chr(34) & ") (list (handent " & Chr(34) & lwpoly.Handle & Chr(34) & ") '(" & pt(0) & " " & pt(1) & " " & pt(2) & ")) "
where "pt" is the pick point I calculated. The problem is that when I run it, I get the message "Cannot EXTEND this object", but I don't want to extend it I want to trim it.
When I do it manually, using the same entities and pick point, it works fine. Do I have to do something different in VBA?
Thanks.
ThisDrawing.SendCommand "trim (handent " & Chr(34) & trimline1.Handle & Chr(34) & ") (handent " & Chr(34) & trimline2.Handle & Chr(34) & ") (list (handent " & Chr(34) & lwpoly.Handle & Chr(34) & ") '(" & pt(0) & " " & pt(1) & " " & pt(2) & ")) "
where "pt" is the pick point I calculated. The problem is that when I run it, I get the message "Cannot EXTEND this object", but I don't want to extend it I want to trim it.
When I do it manually, using the same entities and pick point, it works fine. Do I have to do something different in VBA?
Thanks.