+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19
  1. #11
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,005

    Default

    Registered forum members do not see this ad.

    Use this line to add the new layer:
    Code:
    (if (not (tblsearch "LAYER" "arcmark"))
     (entmakex '((0 . "LAYER") (100 . "AcDbSymbolTableRecord") (100 . "AcDbLayerTableRecord")
                 (2 . "arcmark") (70 . 0) (62 . 3) (6 . "Continuous")))
    )
    To get the circles/blocks in desired layer just adjut:
    Code:
    (entmake (list '(0 . "CIRCLE") (cons 10 p) (cons 40 r) '(8 . "arcmark")))
    ...
    (entmake (list '(0 . "INSERT") (cons 10 p) (cons 2 b) '(8 . "arcmark")))
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  2. #12
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Lives in Abu Dhabi
    Posts
    2,631

    Default

    Quote Originally Posted by MSasu View Post
    @motee-z: Just add the line below to Tharwat's code:
    Code:
    (vl-load-com)
    Thank you Mircea .

    Quote Originally Posted by motee-z View Post
    it works tharwat after adding (vl-load-com)
    but polylines arcs not considered

    thank you very much

    You're welcome .

    Polylines are not included because you did not ask about them into your first post .
    - When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said

  3. #13
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    Quote Originally Posted by Tharwat View Post
    Polylines are not included because you did not ask about them into your first post .
    Quote Originally Posted by motee-z View Post
    hello tharwat
    any diameter(optional)any block in the drawing
    command line:
    select arcs: all arcs selected even polyline if contain circles
    enter radius of circle or name of block:

    ..........
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  4. #14
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Lives in Abu Dhabi
    Posts
    2,631

    Default

    I considered the first post , and I was writing the code when the OP replied to my first post .

    Anyway , You did a very good routine that I learned how to include Polyline 's arc within the selection set filtration system.
    - When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said

  5. #15
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Lives in Abu Dhabi
    Posts
    2,631

    Default

    Quote Originally Posted by motee-z View Post
    i tried to add these lines in all possible places to create layer named(markarc) to lay circles on but i failed
    (command "layer" "make" "arcmark" "")
    (command "layer" "c" "3" "arcmark" "")
    (command "color" "bylayer")
    any suggestion
    Try it now ....

    Code:
    (defun c:Test (/ ss i sn ins d bname)
    ;;; Tharwat 10. June. 2012  ;;;
      (vl-load-com)
      (if
        (and
          (setq ss (ssget "_x"
                          '((-4 . "<OR")
                            (0 . "ARC")
                            (-4 . "<AND")
                            (0 . "LWPOLYLINE")
                            (-4 . "<>")
                            (42 . 0.0)
                            (-4 . "AND>")
                            (-4 . "OR>")
                           )
                   )
          )
          (progn
            (initget "Circle Block")
            (setq ins (getkword "\n Choose one [Circle/Block] :"))
          )
        )
         (progn
           (if (not (tblsearch "LAYER" "arcmark"))
             (entmakex '((0 . "LAYER")
                         (100 . "AcDbSymbolTableRecord")
                         (100 . "AcDbLayerTableRecord")
                         (2 . "arcmark")
                         (70 . 0)
                         (62 . 3)
                         (6 . "Continuous")
                        )
             )
           )
           (if (eq ins "Block")
             (progn
               (setq bname (getstring t "\n Enter name of Block :"))
               (tblsearch "BLOCK" bname)
               (repeat (setq i (sslength ss))
                 (setq sn (ssname ss (setq i (1- i))))
                 (foreach p (list (vlax-curve-getstartpoint sn)
                                  (vlax-curve-getendpoint sn)
                            )
                   (entmakex (list '(0 . "INSERT")
                                   (cons 2 bname)
                                   (cons 10 p)
                                   '(8 . "arcmark")
                                   '(41 . 1.0)
                                   '(42 . 1.0)
                                   '(43 . 1.0)
                             )
                   )
                 )
               )
             )
             (progn
               (if (setq d (getdist "\n Specify Diameter of Circle :"))
                 (repeat (setq i (sslength ss))
                   (setq sn (ssname ss (setq i (1- i))))
                   (foreach p (list (vlax-curve-getstartpoint sn)
                                    (vlax-curve-getendpoint sn)
                              )
                     (entmakex (list '(0 . "CIRCLE")
                                     '(8 . "arcmark")
                                     (cons 10 p)
                                     (cons 40 d)
                               )
                     )
                   )
                 )
               )
             )
           )
         )
         (princ)
      )
      (princ)
    )
    - When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said

  6. #16
    Senior Member
    Using
    not specified
    Join Date
    Feb 2006
    Posts
    243

    Default

    thank you tharwat for your effort

  7. #17
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Lives in Abu Dhabi
    Posts
    2,631

    Default

    Quote Originally Posted by motee-z View Post
    thank you tharwat for your effort
    You're welcome anytime ..
    - When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said

  8. #18
    Super Member irneb's Avatar
    Computer Details
    irneb's Computer Details
    Operating System:
    Win7 Pro 64bit
    Computer:
    Antec One Hundred
    Motherboard:
    ASUS P8P67-Pro P67
    CPU:
    Intel i7 2600 @ 3.4GHz
    RAM:
    16GB-1600MHz
    Graphics:
    GeForce GT 430 (1GB)
    Primary Storage:
    Seagate1TB SATA2 - 7200rpm
    Monitor:
    Samsung 2333TN 23" 1920 x 1080 Full HD LCD Monitor2GW
    Discipline
    Architectural
    irneb's Discipline Details
    Occupation
    Architectural Technician and Programmer
    Discipline
    Architectural
    Using
    AutoCAD 2013
    Join Date
    Sep 2010
    Location
    Jo'burg SA
    Posts
    1,634

    Default

    Lee I like these constructs:
    Code:
    (setq f (lambda ( p ) (entmake (list '(0 . "CIRCLE") (cons 10 p) (cons 40 r)))))
    Though, what would be the difference if you simply used a normal defun statement instead of setq+lambda?
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  9. #19
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by irneb View Post
    Lee I like these constructs:
    Code:
    (setq f (lambda ( p ) (entmake (list '(0 . "CIRCLE") (cons 10 p) (cons 40 r)))))
    Thank you Irné

    Quote Originally Posted by irneb View Post
    Though, what would be the difference if you simply used a normal defun statement instead of setq+lambda?
    To my knowledge, a negligible difference in performance, though, since the function 'f' is different for each option and is created during runtime I felt it more suitable to use an anonymous lambda function rather than using a defun expression. I tend to reserve defun expressions for cases in which the function is static and isolated from the main function (i.e. does not share local variables with the main function).
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

Similar Threads

  1. break arcs & circles with 5mm gap - No 2
    By jimpcfd in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 2nd Aug 2010, 09:00 pm
  2. Arcs and Circles
    By aldawn in forum AutoCAD Beginners' Area
    Replies: 6
    Last Post: 19th Nov 2009, 11:34 am
  3. arcs and extruding circles
    By xander3 in forum AutoCAD 3D Modelling & Rendering
    Replies: 3
    Last Post: 16th Dec 2008, 03:38 pm
  4. arcs print different than circles
    By phonhead in forum AutoCAD Drawing Management & Output
    Replies: 14
    Last Post: 23rd Aug 2007, 05:27 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