Results 1 to 5 of 5

Thread: quick question

  1. #1
    I could stop if I wanted to
    Join Date
    2007-05
    Location
    Brookfield WI
    Posts
    331
    Login to Give a bone
    0

    Default quick question

    I want to add to a routine I already have, it is for elec ductwork...anyway most duct comes off equipment at an angle and then runs straight to closest wall. I want to start with obtaining the angle, then drawing the first line...lets say @24<angle...make sense?

    I don't know how to get the @24<ang into my code..

    Here is my code

    Code:
    (defun c:ga()
    ;;;  (setvar "angbase" 90)
        (setq ang (getangle)
    	  )
      )
    (setq pt1 (getpoint)
          )
    (command "._line" pt1 "" )

  2. #2
    All AUGI, all the time
    Join Date
    2015-12
    Location
    Central Oregon
    Posts
    591
    Login to Give a bone
    0

    Default Re: quick question

    Here's one way. Needs to have error checking/trapping included in case the users cancels out of the command, but should give the idea.
    Code:
    (defun c:ga (/ ANG ANGVAR ORTHMODE PT1)
      (setq	ang	 (getangle "\nStart angle?: ")
    	angvar	 (getvar 'snapang)
    	orthmode (getvar 'orthomode)
      )
      (setq pt1 (getpoint "\nStart point: "))
      (setvar 'snapang ang)
      (setvar 'orthomode 1)
      (command "._line"
    	   pt1
    	   pause
    	   ""
      )
      (setvar 'snapang angvar)
      (setvar 'orthomode orthmode)
      (princ)
    )

  3. #3
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    466
    Login to Give a bone
    0

    Default Re: quick question

    How about using POLAR ?

  4. #4
    All AUGI, all the time CAB2k's Avatar
    Join Date
    2016-01
    Location
    Brandon, Florida
    Posts
    687
    Login to Give a bone
    0

    Default Re: quick question

    Another way:
    Code:
    (defun c:ga(/ pt1)
      (if (setq pt1 (getpoint "\nStart point: "))
        (vl-cmdf "._line" "_non" pt1 "<24" pause)
      )
      (princ)
    )

  5. #5
    I could stop if I wanted to
    Join Date
    2007-05
    Location
    Brookfield WI
    Posts
    331
    Login to Give a bone
    0

    Default Re: quick question

    Quote Originally Posted by CAB2k View Post
    Another way:
    Code:
    (defun c:ga(/ pt1)
      (if (setq pt1 (getpoint "\nStart point: "))
        (vl-cmdf "._line" "_non" pt1 "<24" pause)
      )
      (princ)
    )
    that is it, thanks Cab

Similar Threads

  1. Quick question
    By preddy08 in forum DWF Viewer - General
    Replies: 1
    Last Post: 2008-11-12, 12:39 AM
  2. A quick question
    By gautamrs in forum Revit Architecture - General
    Replies: 4
    Last Post: 2008-05-12, 07:25 PM
  3. A qq (quick question)
    By dpasa in forum Revit Architecture - General
    Replies: 4
    Last Post: 2007-02-27, 04:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •