Jump to content

Recommended Posts

Posted

Here is what I have:

 

(defun c:isol (/ ic)

 (initget 6)
 (if (setq ic (getdist "\nEnter Length: "))
   (command "_.LINE" "" (* ic 0.816496581)))

 (princ))

 

Im trying to create a line command where it asks for a certain length and it draws the line. but what im having a problem with is, allowing me to click the base point of the line then selecting the proper angle then drawing the line to the reduced scale of the length I specified.

Posted

A very funny idea MikeP , I did really like it .:)

 

Hope this would meet your needs .

 

(defun c:test (/ p ang l p1)
 (if (setq p (getpoint "\n base point :"))
   (progn
     (while
       (setq Ang (getangle p "\n Next point for Angle :"))
        (setq l (getdist "\n Specify length :"))
        (entmakex (list (cons 0 "LINE")
                        (cons 10 p)
                        (cons 11 (setq p1 (polar p ang l)))
                  )
        )
        (setq p p1)
     )
   )
   (princ)
 )
 (princ)
)

 

Tharwat

Posted

Having problems. when I try to load it in the appload. it just says unknown command when I try to use it. I did change the shortcut in the command to something other than test.

 

thanks. I use it to make isometric drawings. that is the scale if you were to go from a SW (or any 3d view) to a plan view. I have a dim style set up with a dim scale equal to that so I can dimension iso drawings.

Posted
Having problems. when I try to load it in the appload. it just says unknown command when I try to use it. I did change the shortcut in the command to something other than test.

.

 

No problem you can change the name of the routine as best as you want , and I also feel something going wrong in here while stepping through thread in the forum.

 

Regards.

Posted

Combine the two programs, then add in a check for the current dimscale...

 

 
(defun c:isol (/ ic ds p ang p1)
 (setq ds (getvar "dimscale"))
 (if (setq p (getpoint "\nBase point :"))
   (progn
     (while
       (setq ang (getangle p "\nSelect Angle :"))
       (initget 6)
       (if (setq ic (getdist "\nEnter Length: "))
         (entmakex (list (cons 0 "LINE")
                              (cons 10 p)
                              (cons 11 (setq p (polar p ang (* ic ds))))
                   )
         )
       )
     )
   )
 )
 (princ)
)

 

:wink:

Posted

What's if the (getvar "dimscale") is equal to zero ?

 

Regards.

Posted

Out of curiosity... why are you not drawing your line work at 1:1 (true scale) in Model Space, and using Paper Space Viewports to handle your scaling? :unsure:

Posted
What's if the (getvar "dimscale") is equal to zero ?

 

Regards.

 

ummm...

 

I have a dim style set up with a dim scale equal to that so I can dimension iso drawings.

 

I didn't think that would be an issue. But, error trapping could check that, and prompt the user if necessary.

Posted

both these programs submitted are not using the scale 0.816496581. I want to enter a length, and it draws a line scaled to my number at the selected angle.

Posted

Will this work?

 

 
(defun c:isol (/ ic ds p ang p1)
 (setq ds [color=red]0.816496581[/color])
 (if (setq p (getpoint "\nBase point :"))
   (progn
     (while
       (setq ang (getangle p "\nSelect Angle :"))
       (initget 6)
       (if (setq ic (getdist "\nEnter Length: "))
         (entmakex (list (cons 0 "LINE")
                              (cons 10 p)
                              (cons 11 (setq p (polar p ang (* ic ds))))
                   )
         )
       )
     )
   )
 )
 (princ)
)

 

Then, the ds variable can be changed to whatever you like.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...