Results 1 to 1 of 1

Thread: ring dish command name

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    2013-02
    Posts
    17
    Login to Give a bone
    0

    Default ring dish command name


    Code:
    ;ring order dishes [draw / modify ] command 
    ;  lijinsong have a bit empty time write at New Year
    
    (defun c:dd(/  rr lst enlst loops ptslst p1 p2 p22 p3a p4a ang1 ang2 cmda ) 
      
      ;design ring
      (setq    p1   ( getvar "viewctr" )  ;;needle rotate point
    
               rr   (/( getvar "viewsize" )10)
    
               lst  '( 
    
                       (0.369411765  "line")
                       (0.738823529  "pline")
                       (1.108235294  "xline")
                       (1.477647059  "polygon")
                       (1.847058824  "rectang")
                       (2.216470588  "arc" )
                       (2.585882353  "circle")
                       (2.955294118  "revcloud")
                       (3.324705882  "spline")
                       (3.694117647  "ellipse")
                       (4.063529412  "insert")
                       (4.432941176  "block")
                       (4.802352941  "point")
                       (5.171764706  "bhatch")
                       (5.541176471  "region")
                       (5.910588235  "text")
                       (6.28         "mtext")
    
                      )
    
               enlst '()
       )
    
       (entmake  (list
                  (cons 0  "CIRCLE" ) 
                  (cons 62  6)        
                  (cons 10  p1) 
                  (cons 40  (* rr 1.3)  ) 
                  ) 
       ) 
    
      ( setq enlst ( cons ( entlast ) enlst ) ) 
    
      (foreach a lst
    
               (entmake 
                      (list 
                           (cons 0  "TEXT")
             (cons 1  (cadr a) )
             (cons 10 (polar p1 (car a) rr) ) 
             (cons 40 (/ rr 10))
             (cons 41 1)
                           (cons 50 0)
             (cons 62 3)
        )
                )    
    
                ( setq enlst ( cons ( entlast ) enlst ) ) 
     
      )
    
      (setq loops  t )
    
      (while loops 
     
        (setq ptslst (grread t 7 0)  )
        
        (if ( or ( = (car ptslst) 3 ) 
    
                 ( = ( car ptslst ) 5 ) 
             )
    
        (progn
           
           (setq 
                 p2  ( cadr ptslst )  
    
                 ang1( angle p1 p2 )  
    
                 ang2( angle p2 p1 ) 
    
           ) ;arrow handle
    
           (setq p3a  (polar p2 (+ ang2 10) (/ rr 10) )  ;;arrow line1
    
                 p4a  (polar p2 (- ang2 10) (/ rr 10) )  ;;arrow line2
    
                 p22  (polar p2 ang2 (/ rr 4) )
               
            ) 
    
           (redraw)
    
           (grdraw p1 p2 4) (grdraw p2 p3a 2) (grdraw p2 p4a 2) (grdraw p3a p4a 2) (grdraw p2 p22 1) 
    
           ;;EXIT FOR 
           (if ( = 3 (car ptslst) ) 
    
           (progn
              
              ( setq loops nil ) 
    
              
              ( if  ( ssget "cp"  (list p2 p3a p4a p2 ) '( ( 0 . "TEXT" ) ( 62 . 3 ) ) ) ;;若有选择集
                   
              ( progn
    
                   ( setq  cmda (cdr(assoc 1 (entget (ssname (ssget "P") 0 ) ) ) )  )
    
    
                   (foreach en enlst   
    
                     (command "erase" en "")
    
                   )
    
                   ( vl-cmdf cmda  )
       
             )  );if ss
    
           )  );if 3 
      
         )  );if 3 5
    
      );for
      
    );defun
    
    
    (defun c:mm(/  rr lst enlst loops ptslst p1 p2 p22 p3a p4a ang1 ang2 cmda ) 
    
      ;设计钟盘
    
      (setq    p1   ( getvar "viewctr" )  ;;指针旋转起点
    
               rr   (/( getvar "viewsize" )10)
    
               lst  '( 
                       
                       (0.369411765 "erase")
                       (0.738823529 "copy")
                       (1.108235294 "mirror")
                       (1.477647059 "offset")
                       (1.847058824 "array")
                       (2.216470588 "move")
                       (2.585882353 "rotate")
                       (2.955294118 "scale")
                       (3.324705882 "stretch")
                       (3.694117647 "trim")
                       (4.063529412 "extend")
                       (4.432941176 "break1")
                       (4.802352941 "break")
                       (5.171764706 "chamfer")
                       (5.541176471 "fillet")
                       (5.910588235 "explode")
                       (6.1 "lengthen")
                       (6.28 "chprop")
    
                      )
    
               enlst '()
       )
    
      (entmake  (list
                  (cons 0  "CIRCLE" ) 
                  (cons 62  1)        
                  (cons 10  p1) 
                  (cons 40  (* rr 1.3)  ) 
                  ) 
       ) 
    
      ( setq enlst ( cons ( entlast ) enlst ) ) 
    
      (foreach a lst
    
               (entmake 
                      (list 
                           (cons 0  "TEXT")
             (cons 1  (cadr a) )
             (cons 10 (polar p1 (car a) rr) ) 
             (cons 40 (/ rr 10))
             (cons 41 1)
                           (cons 50 0)
             (cons 62 3)
        )
                )    
    
                ( setq enlst ( cons ( entlast ) enlst ) ) 
     
      )
    
      (setq loops  t )
    
      (while loops 
     
        (setq ptslst (grread t 7 0)  )
        
        (if ( or ( = (car ptslst) 3 ) 
    
                 ( = ( car ptslst ) 5 ) 
             )
    
        (progn
           
           (setq 
                 p2  ( cadr ptslst )  
    
                 ang1( angle p1 p2 )  
    
                 ang2( angle p2 p1 ) 
    
                 ;p2a ( polar p1 ang1 rr ) 
    
           ) ;箭柄
    
           (setq p3a  (polar p2 (+ ang2 10) (/ rr 10) )  ;;箭头线1
    
                 p4a  (polar p2 (- ang2 10) (/ rr 10) )  ;;箭头线2
    
                 p22  (polar p2 ang2 (/ rr 4) )
               
            ) 
    
           (redraw)
    
           (grdraw p1 p2 4) (grdraw p2 p3a 2) (grdraw p2 p4a 2) (grdraw p3a p4a 2) (grdraw p2 p22 1) 
    
           ;;EXIT FOR 
           (if ( = 3 (car ptslst) ) 
    
           (progn
              
              ( setq loops nil ) 
    
              
    
              ( if  ( ssget "cp"  (list p2 p3a p4a p2 ) '( ( 0 . "TEXT" ) ( 62 . 3 ) ) ) ;;若有选择集
                   
              ( progn
    
                   ( setq   cmda(cdr(assoc 1 (entget (ssname (ssget "P") 0 ) ) ) )  )
    
                   (foreach en enlst   
    
                     (command "erase" en "")
    
                   )
    
                   ( if ( = cmda "break1" )  
    
                       ( command  "break" (entsel) "f" (getpoint) "@"   )
      
                   ) ;if cmd
    
                   ( if ( = cmda "LENGTHEN" )  
    
                       (COMMAND?"LENGTHEN" "DY")
      
                   ) ;if cmd
    
                  ( vl-cmdf cmda  )
      
             )  );if ss
    
           )  );if 3 
      
         )  );if 3 5
    
      );for
      
    
    );defun


    [ModeratorAction] Please use [CODE ] Tags [/ModeratorAction]
    Last edited by RenderMan; 2013-02-14 at 04:17 AM.

Similar Threads

  1. 2012: Ring Circuit?
    By micromagic in forum Revit MEP - General
    Replies: 4
    Last Post: 2011-11-08, 11:40 AM
  2. Looking for satellite dish.
    By chukarov in forum Revit Architecture - Families
    Replies: 0
    Last Post: 2004-08-27, 06:21 PM
  3. Looking for satellite dish.
    By chukarov in forum Revit Architecture - General
    Replies: 0
    Last Post: 2004-08-27, 06:21 PM

Tags for this Thread

Posting Permissions

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