Trim in VBA

Trim in VBA

Anonymous
Not applicable
1,544 Views
1 Reply
Message 1 of 2

Trim in VBA

Anonymous
Not applicable
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.
0 Likes
1,545 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Hi,

I don't know much about LISP, but when I simulate youre code, I get a
trimmed line.
I created 2 polylines... Handle 10a and 10b.

ThisDrawing.SendCommand "_trim (handent " & Chr(34) & "10a" & Chr(34) &
") (handent " & Chr(34) & "10b" & Chr(34) & ") (list (handent " & Chr(34) &
"10b" & Chr(34) & ") '(" & pt(0) & " " & pt(1) & " " & pt(2) & ")) "


a écrit dans le message de news: 5772912@discussion.autodesk.com...
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.
0 Likes