GigaFHLS Posted August 11, 2014 Posted August 11, 2014 Hello, I'm very new to Autolisp, and I am having some trouble with my code. Here's a description of what I am trying to do: I have a drawing consisting of two pipes, bottom pipe and upper pipe. They will be inclined in reference to the paper, represented by the square. I need to insert at the end of these pipes a block (inside the block will be a leader), which then will be rotated to align itself with the paper orientation. Somehow, the code i've written so far is not working, I believe it's because i'm not getting the correct syntax of the commands i'm using. Would anyone be willing to take a look? Help is much appreciated. See attached files for my code and the drawing (containg the desired block) ttten.LSP Drawing1.dwg Quote
Tharwat Posted August 11, 2014 Posted August 11, 2014 Welcome to CADTutor . Suppose that you know the rotation angle and it is assigned to variable rot in the following example . (if (and (tblsearch "BLOCK" "test2") (setq rot 45.0) (setq p (getpoint "\n Specify insertion point :")) ) (command "_.-insert" "test2" "_non" p "1" "1" rot) ) Quote
CheSyn Posted August 11, 2014 Posted August 11, 2014 Under ;Calculations You have not set anything for angpt uppercurvepoint or bottomcurvepoint. Move your defuns above this section. Additionally, I would be more apt to use an entmod. Quote
BIGAL Posted August 12, 2014 Posted August 12, 2014 Be careful to that if you change the units accidently setting rot to 45 is what degrees or radians look into the setvars before doing angles (SETVAR "LUNITS" 2) (SETVAR "ANGBASE" 0.0) (SETVAR "ANGDIR" 0) (SETVAR "LUPREC" 0) (SETVAR "AUNITS" 0) (SETVAR "AUPREC" 0) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.