Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Clipping lisp

8 REPLIES 8
Reply
Message 1 of 9
robert06
1705 Views, 8 Replies

Clipping lisp

wondering, why this won't work, when selcting xref to clip, I get 'non found'

 

(defun c:c4 ()
    (command "clip" pause "n" "y" "p" pause pause pause "")
    (princ)
)

 

8 REPLIES 8
Message 2 of 9
rkmcswain
in reply to: robert06

When I run it, I get this:

 

Command: C4
clip
"CLIP" Select Object to clip: 1 found

Enter clipping option
[ON/OFF/Clipdepth/Delete/generate Polyline/New boundary] <New>: n Outside mode - Objects outside boundary will be hidden.
Specify clipping boundary or select invert option:
[Select polyline/Polygonal/Rectangular/Invert clip] <Rectangular>: y
Invalid option keyword.
; error: Function cancelled

 What is the "Y" a response to on your end?

 

 

R.K. McSwain     | CADpanacea | on twitter
Message 3 of 9
robert06
in reply to: rkmcswain

Delete old boundaries: Yes

Message 4 of 9
hmsilva
in reply to: robert06

Try

(defun c:c4 ()
    (command "_.xclip" pause "" "n" "y" "p" pause pause pause "")
    (princ)
)

HTH

Henrique

EESignature

Message 5 of 9
robert06
in reply to: robert06

Acad CLIP seems to differ on apps, I use Civil 3d 2014.

 

Without the lisp:

 

Command: CLIP
Select Object to clip: 1 found

Enter clipping option
[ON/OFF/Clipdepth/Delete/generate Polyline/New boundary] <New>: N
Delete old boundary(s)? [Yes/No] <Yes>: Y
Outside mode - Objects outside boundary will be hidden.
Specify clipping boundary or select invert option:
[Select polyline/Polygonal/Rectangular/Invert clip] <Rectangular>: P

.....

 

With the lisp:

Command: c4

clip Select Object to clip:
Select objects: n

*Invalid selection*
Expects a point or Window/Last/Crossing/BOX/ALL/Fence/WPolygon/CPolygon/Group/Add/Remove/Multiple/Previous/Undo/AUto/SIngle
; error: Function cancelled

 

In case (command "clip" pause "" "n" "y" "p" pause pause pause "")

I get:

 

Command: C4 clip Select Object to clip:
Select objects:
None found.
Command: n Unknown command "N". Press F1 for help.

Command: y Unknown command "Y". Press F1 for help.

Command: p Unknown command "P". Press F1 for help.

 

Message 6 of 9
robert06
in reply to: hmsilva

with this change it worked "_xclip" not "_.xclip"

 

thank you!


@hmsilva wrote:

Try

(defun c:c4 ()
    (command "_.xclip" pause "" "n" "y" "p" pause pause pause "")
    (princ)
)

HTH

Henrique




Message 7 of 9
hmsilva
in reply to: robert06

You're welcome, Robert

 

Should work with "_.xclip"...

 

Henrique

 

 

EESignature

Message 8 of 9
rkmcswain
in reply to: robert06

Ah. Then you should probably accommodate for the instances where there is no existing boundaries, unless this is a specific routine only used where there will be one.
R.K. McSwain     | CADpanacea | on twitter
Message 9 of 9
robert06
in reply to: rkmcswain

ok, thank you for cehecking this out!


@rkmcswain wrote:
Ah. Then you should probably accommodate for the instances where there is no existing boundaries, unless this is a specific routine only used where there will be one.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost