Clipit

Clipit

GeryKnee
Advocate Advocate
1,472 Views
3 Replies
Message 1 of 4

Clipit

GeryKnee
Advocate
Advocate

Hello,

  I want to use the clipit command without user definition of clipping edge object and clipping objects.

That's because i will use the simple acad OLE server call :

  Acad.activedocument.sendcommand ('MyClipit');

I think that one simple way , and it's enough for me.

Insead of asking for clipping edge and clipping object , code uses the objects of a layer (let it be "ClipingArea").

If there are two objects on layer, One of type polyline (closed) or cycle or arc or ellipse , (this will be the clipping edge) and another one  of type image whipeout, xref or block (the clipping object) , the routine completes the whole work.

Thanks,

Gery.

  

0 Likes
1,473 Views
3 Replies
Replies (3)
Message 2 of 4

Sea-Haven
Mentor
Mentor

If you look at the Express EXTRIM.lsp it actually uses a sub defun (ETRIM ent pt) so you could pass it your entity and a dummy relevant point I have used (getvar 'extmax) as the point. So no user input.

0 Likes
Message 3 of 4

GeryKnee
Advocate
Advocate

Hello Sea.heaven

searching web i found the EXTRIM.LSP in web address  https://github.com/Manenpren/autolisp-utilerias/blob/master/extrim.lsp
It contains an "extrim" command.

Testing the command using autocad command line i show that running the routine , asks for objects. In addition i can't undertand how it works.

In my post i determined that i need a routine that works with two objects found on a layer.

The One is Clipper and the other the Clipping object.

The layer sould be constant layer or a layer name routine asks for.

If the layer exists and the two proper objects lay on layer exist , the command is completing the clipping work.

The reason i want this , is that my ability to clip a blockref object for example , using the autocad ole object servises is to execute a command using the "SendCommand" method of document object.

If a lisp command asks for string or integer number or real number or boolean maybe the variables sould be passed as strings. But if lisp routines asks user for objects selection on screen, there's a problem. For example ::: Let MyBlockRef be an OleVariant (an Ole Object) wich was created using ole server and using "insert" ole method. If i want to clip it , it sould exist an ole method MyBlockRef.Clipit(aClipperPolylineVariable) where aClipperPolylineVariable sould be a 2d Polyline object on model space or an array variant of 2d points. Unfortunattely "MyBlockRef.Clipit" method is not supported.

So, I have to use just a call to a lisp command that asks only for string or numbers ... etc.

To insert an entity using string or numbers, there are not many ways.

         First way is to pass the object's handle that is a unique <<ID>> , number for lisp, string for ole objects (MyObject.Handle). Maybe it works but i never tryied because my lisp language knowledge is extremelyy poor, and of course if i am too old aged man to learn lisp. If covid will let me alive, i'll do it. It's not easy, because i spent my life making millions of codes using Pascal (delphi).

           Second way is to put the objects the routine needs on a temporary layer used to run the routine discovering the objects on it.

I think i clearified the whole problem.

Regards,

Gery.

0 Likes
Message 4 of 4

Sea-Haven
Mentor
Mentor

Post a dwg really need to see what your clipping its much better to post an image etc rather than lots of words. Just trying to work out exactly what your doing.

 

Extrim is part of Autocad "Express", there is also another cookiecutter.lsp that is very good also. 

 

Just draw some parallel lines, then put a circle over them, extrim pick circle, then inside circle.

 

screenshot350.png

 

0 Likes