+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Forum Newbie
    Using
    AutoCAD 2011
    Join Date
    Nov 2016
    Posts
    8

    Default Problem with function ACET-.......

    Registered forum members do not see this ad.

    Hello everybody.
    Can anyone halp me with this code:

    Code:
    defun getfencesel (en flt / fe ss)    
          (vl-cmdf "_ZOOM" "_E")
    	  (setq ss (ssadd en))
          (setq fe (acet-list-remove-adjacent-dups (acet-geom-object-point-list en 0.05)) 
                ss (ssget "_F" fe flt)
          )
          (vl-cmdf "_ZOOM" "_P")
          ss
       )
    Maybe someone known how it rewrite into normal Autolisp or Vlisp??
    Last edited by rkmcswain; 17th Feb 2017 at 09:07 pm. Reason: Added [CODE] tags

  2. #2
    Super Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2015
    Join Date
    Nov 2013
    Posts
    1,027

    Default

    Heres my attempt:
    Code:
    ; (sssetfirst nil (GetFenceSel (car (entsel)) '((0 . "*TEXT")) 3))
    ; (sssetfirst nil (GetFenceSel (car (entsel)) nil 3))
    (defun GetFenceSel ( e flt prec / DivideCurveAtInc Trap pL ll ur SS )
      
      (defun DivideCurveAtInc ( i c / TotLen d PtLst )
        (if
          (and
            (numberp i) (not (or (zerop i) (minusp i)))
            (not (vl-catch-all-error-p (vl-catch-all-apply 'vlax-curve-getEndParam (list c)))) 
            (<= i (setq TotLen (vlax-curve-getDistAtParam c (vlax-curve-getEndParam c))))
          )
          (progn
            (setq d 0.0)
            (while (<= d TotLen)
              (setq PtLst (cons (vlax-curve-getPointAtDist c d) PtLst))
              (setq d (+ d i))
            ); while
            (setq PtLst (reverse PtLst))
          ); progn
        ); if
        PtLst
      ); defun DivideCurveAtInc
      
      (defun Trap ( f L / r err ) (if (setq err (not (vl-catch-all-error-p (setq r (vl-catch-all-apply f L))))) (if r r err)) )
      (cond
        ( (not (setq e (Trap 'vlax-ename->vla-object (list e))))
          (princ "\nNo object provided.")
        )
        ( (not (Trap 'vla-GetBoundingBox (list e 'll 'ur)))
          (princ "\nInvalid object.")
        )
        (
          (or
            (and
              (Trap 'vlax-curve-getEndParam (list e))
              (setq pL (mapcar '(lambda (x) (reverse (cdr (reverse x)))) (DivideCurveAtInc prec e)))
            )
            (setq pL
              (
                (lambda ( x / p1 p2 ) (setq p1 (car x)) (setq p2 (cadr x)) (list p1 (list (car p1) (cadr p2)) p2 (list (car p2) (cadr p1))) )
                (mapcar '(lambda (x) (reverse (cdr (reverse (safearray-value x))))) (list ll ur))
              )
            )
          ); or
          (vla-ZoomWindow (vlax-get-acad-object) ll ur)
          (and
            (setq SS (ssget "_F" pL flt))
            (ssadd (vlax-vla-object->ename e) SS)
          )
          (vla-ZoomPrevious (vlax-get-acad-object))
        )
      ); cond
      SS
    ); defun GetFenceSel
    (vl-load-com) (princ)
    Where 'prec is the unit increment for the curve to be divided.

    HTH

  3. #3
    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
    19,307

    Default

    You could use this in place of acet-geom-object-point-list.
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  4. #4
    Forum Newbie
    Using
    AutoCAD 2011
    Join Date
    Nov 2016
    Posts
    8

    Default

    I've put wrong code. This is corect:

    Code:
    (defun getfencesel (en flt / fe ss)    
          (acet-ss-zoom-extents (setq ss (ssadd en)))
          (setq fe (acet-list-remove-adjacent-dups (acet-geom-object-point-list en 0.05)) 
                ss (ssget "_F" fe flt)
          )
          (vl-cmdf "_ZOOM" "_P")
          ss
       )
    The all lisp is here:
    https://www.theswamp.org/index.php?topic=9042.465

    File: TriangV0.6.7.LSP by ymg

    Becouse my CAD don't have Acad Express Tools so I have to change the TriangV0.6.7.LSP.
    I've changed the parts with function:
    pragma
    vl-times
    acet-ui-progress
    ..adne command TIN is working, but PROF still isn't.

    I've put grrr code instead fragment with error but it doesn't work. My knowledge of this is over.
    I'm still using COMAND

    I will be grateful for your help.

    Pawcyk
    Last edited by rkmcswain; 17th Feb 2017 at 09:07 pm. Reason: Added [CODE] tags

  5. #5
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO 64-bit
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x64
    CPU:
    Pentium(R) i5 4570 @ 3.2GHz
    RAM:
    8 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    2x ThinkVision 24"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2011
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    11,669

    Default

    Please read the Code Posting Guidelines and edit your Code to be included in Code Tags.[CODE]Your Code Here[/CODE] =
    Code:
    Your Code Here
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



  6. #6
    Forum Newbie
    Using
    AutoCAD 2011
    Join Date
    Nov 2016
    Posts
    8

    Default

    Can I change my posts now? If not I will try do it corectly in the future. My english isn't as good as I want thats why I could missed it.

    Pawcyk

  7. #7
    Forum Newbie
    Using
    AutoCAD 2011
    Join Date
    Nov 2016
    Posts
    8

    Default

    Lee Mac your code is working, thank you very much.

  8. #8
    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
    19,307

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by pawcyk View Post
    Lee Mac your code is working, thank you very much.
    Excellent - you're welcome!
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

Similar Threads

  1. (acet-geom-ss-extents-accurate) function errors in A2016,A2017
    By marko_ribar in forum AutoCAD Bugs, Error Messages & Quirks
    Replies: 0
    Last Post: 5th May 2016, 01:58 pm
  2. Problem in IF function
    By mostafa badran in forum AutoLISP, Visual LISP & DCL
    Replies: 12
    Last Post: 17th Apr 2014, 12:45 pm
  3. after loding lisp : "error no function definition , ACET-STR-FORMAT"
    By Salama in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 28th Mar 2014, 11:03 pm
  4. ACET-SS-Filter function
    By ectech in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 21st Jun 2010, 09:33 am
  5. how to use acet-ss-filter
    By ectech in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 4th Jan 2010, 09:36 am

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