+ Reply to Thread
Page 3 of 3 FirstFirst 1 2 3
Results 21 to 23 of 23
  1. #21
    Forum Deity BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    256GB SSD
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Using
    Civil 3D 2015
    Join Date
    Nov 2009
    Posts
    4,748

    Default

    Registered forum members do not see this ad.

    For fun:

    Code:
    (defun c:FOO ( / *error* _GetAngle _Nomutt )
      (vl-load-com)
    
      (defun *error*  (msg)
        (and oldNomutt (setvar 'nomutt oldNomutt))
        (and oldOsmode (setvar 'osmode oldOsmode))
        (if acDoc
          (vla-endundomark acDoc))
        (cond ((not msg))                                                   ; Normal exit
              ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
              ((princ (strcat "\n** Error: " msg " ** "))))                 ; Fatal error, display it
        (princ))
    
      (defun _GetAngle  ( basePoint / opt )
        (initget 128 "Point")
        (if (or (setq opt
                       (getkword "\nEnter an angle in degrees [Point] <Point>: "))
                (setq opt "Point"))
          (cond ((= "Point" opt)
                 (if (and (not (initget 32))
                          (setq anchorPoint
                                 (getpoint basePoint
                                           "\nSpecify angle by point: ")))
                   (* 180.0 (/ (angle basePoint anchorPoint) pi))))
                ((atof opt)))))
    
      (defun _Nomutt  ( on / )
        (if on
          (setvar 'nomutt 0)
          (setvar 'nomutt 1)))
    
      ((lambda ( acDoc oldNomutt oldOsmode / ss basePoint ang )
         (if (and (setvar 'osmode 5)
                  (princ "\nSelect object(s): ")
                  (_Nomutt nil)
                  (setq ss (ssget "_:L"))
                  (_Nomutt T)
                  (setq basePoint (getpoint "\nSpecify base point: "))
                  (setq ang (_GetAngle basePoint)))
           (progn
             (_Nomutt nil)
             (vla-startundomark acDoc)
             (terpri)
             (initcommandversion 1)
             (vl-cmdf "._array" ss "" "C" basePoint ang "-360" "Y")
             (*error* nil))
           (cond (basePoint (*error* "No angle specified"))
                 (ss (*error* "No base point specified"))
                 ((*error* nil)))))
        (vla-get-activedocument (vlax-get-acad-object))
        (getvar 'nomutt)
        (getvar 'osmode)))
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD® 2014, and Civil 3D® 2014 Certified Professional | Autodesk® Authorized Developer
    Autodesk Exchange Apps ~ Autoloader ~ AutoCAD Security

  2. #22
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,640

    Default

    Quote Originally Posted by aswini View Post
    It is working excellent thanq verymuch,i have onemore doubt if i want the input as only number of lines and not the angle,what i have to do??
    Thanks
    You are welcome aswini:

    Code:
    (defun c:FunArray  (/ ss bp op)
    (setq val (mapcar '(lambda (v)
                             (getvar v)) (list 'Cmdecho 'Osmode)))
    (cond ((and
          (princ "\mSelect Objects to array: ")      
          (setq ss (ssget))
          (setvar 'osmode 5)(setvar 'cmdecho 0)
          (setq bp (getpoint "\nPick Base point:"))
          (setq ang (cond
         ((getangle (strcat "\nEnter Angle <" (angtos (setq ang
           (cond ( ang ) ( 0.0 ))))">: "
             )))( ang ))
          ))
          (initcommandversion 1)
          (command "_array" ss "" "C"  bp (/ (* ang 180.0) pi)(progn
                (setq op (getint "\nNumber of Items: [Enter for 360 fill]: "))
                (if op op  "-360"))  "Y")
           ))
          (mapcar '(lambda (v y)
                             (setvar v y)) (list 'Cmdecho 'Osmode) val)
          (princ)
          )
    Quote Originally Posted by Tharwat View Post
    @pBe , You are changing the OP osmode settings without re-set them back with (setvar 'osmode 5)
    I'm lazy that way tharwat.

    Quote Originally Posted by RenderMan View Post
    For fun:
    Its giving odd results when using "point" option. <starting point of angle> me thinks

  3. #23
    Forum Deity BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    256GB SSD
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Using
    Civil 3D 2015
    Join Date
    Nov 2009
    Posts
    4,748

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by pBe View Post
    Its giving odd results when using "point" option. <starting point of angle> me thinks
    Hrmmm... That must be due to my only testing the routine in WCS, with Plan=World. I also neglected to TRANSlate the point(s).
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD® 2014, and Civil 3D® 2014 Certified Professional | Autodesk® Authorized Developer
    Autodesk Exchange Apps ~ Autoloader ~ AutoCAD Security

Similar Threads

  1. how to write 2 foreach loops in a program
    By gvgbabu in forum AutoLISP, Visual LISP & DCL
    Replies: 19
    Last Post: 15th Apr 2011, 07:17 pm
  2. how to write lisp program
    By srinu_vasu38 in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 17th Apr 2010, 10:09 am
  3. Jpg attachment
    By aravindkpe in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 3
    Last Post: 3rd Aug 2009, 06:42 am
  4. Autolisp program to generate grid lines
    By skipo4us in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 25th Mar 2008, 07:49 pm

Bookmarks

Posting Permissions

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