AutoLISP Chamfer Usage

AutoLISP Chamfer Usage

Anonymous
Not applicable
1,902 Views
3 Replies
Message 1 of 4

AutoLISP Chamfer Usage

Anonymous
Not applicable

I'm trying to chamfer the top edge of a cylinder without user input given the two chamfer distances.

(command "chamfer" "d" ChamX ChamY pt2 "") ;this is what I'm trying to use, where ChamX and ChamY are the chamfer distances, and pt2 is a point on the edge of the cylinder I'm trying to chamfer. I've tried several variations trying to select the edge as an entitiy, trying the function with the edge selected first. No matter what I do the chamfer function doesn't work. Any help would be appreciated.

0 Likes
Accepted solutions (1)
1,903 Views
3 Replies
Replies (3)
Message 2 of 4

paullimapa
Mentor
Mentor

Does it work when you manually enter the same sequence of commands using the basic AutoCAD CHAMFER command?

 

 

 

Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales | Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 4

Anonymous
Not applicable

Yes, it works outside of autolisp, and autocad even has the numbers entered in and saved.

0 Likes
Message 4 of 4

paullimapa
Mentor
Mentor
Accepted solution

This is the sequence of commands I would pass through lisp to get Chamfer to work on a 3d Cylinder's edge:

(setq ob (entsel)) ; select edge of cylinder

(setq pt (cadr ob)) ; get selected point on edge

(setq chamfx (getdist)) ; enter first chamfer value like 0.25

(setq chamfy (getdist)) ; enter second chamfer value like 0.5

(command"_.Chamfer" pt "" chamfx chamfy pt "") ; execute Chamfer command

 

 

Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales | Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes