+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
  1. #1
    Super Member skipsophrenic's Avatar
    Computer Details
    skipsophrenic's Computer Details
    Operating System:
    Vista 32 bit
    Computer:
    Compaq
    Motherboard:
    erm . . yeah?
    CPU:
    Intel Pentium Dual CPU E2140 @ 1.60 Ghz
    RAM:
    2039MB
    Graphics:
    don't ask you'll kill me
    Primary Storage:
    360gb
    Monitor:
    21" widescren - 16:10 ratio
    Using
    AutoCAD 2008
    Join Date
    Jul 2008
    Location
    Birmingham, United Kingdom
    Posts
    1,020

    Default Flatten lisp not working.

    I've been using the lisp from THIS thread since i got it.
    Up untill now have not had any problems, howevey when
    i used it today, looking at everythin from the side, it has l
    eft entities on 3 distinct elevations,

    Any clue's on why this is happening now?

    F.Y.I. this is a BIG drawing
    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein

    SET FILEDIA = 1

  2. #2
    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
    16,619

    Default

    I may be way off the mark here, but have you tried the LISP with all your OSNAPs off?

    from quickly glancing at the LISP on the hyperlinked threads, I notice that it doesn't turn OSNAPs off before moving the entities...
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  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
    16,619

    Default

    Also, check that the entities are not on locked layers, as this will also cause a problem.
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  4. #4
    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
    16,619

    Default

    This should cope with R14, and also with objects on locked layers:

    Code:
    (defun c:flat  (/ ss ssObj i j)
      (vl-load-com)
      (if (setq ss (ssget "X"
                  (list (if    (getvar "CTAB")
                      (cons 410 (getvar "CTAB"))
                      (cons 67 (- 1 (getvar "TILEMODE")))))))
        (progn
          (setq ssObj (mapcar 'vlax-ename->vla-object
                  (mapcar 'cadr (ssnamex ss))) i 0 j 0)
          (foreach Obj  ssObj
        (foreach n  '(1e99 -1e99)
          (if (vl-catch-all-error-p
            (vl-catch-all-apply
              '(lambda (x)
                 (vla-move x (vlax-3d-point (list 0 0 0))
                       (vlax-3d-point (list 0 0 n))))
              (list Obj)))
            (setq i (1+ i)) (setq j (1+ j)))))
          (princ (strcat "\n" (rtos (/ j 2.0)) " Objects Flattened"
                 (if (zerop i) "." (strcat ", " (rtos (/ i 2.0))
                               " were on a Locked Layer!")))))
        (princ "\n<!> No Objects Found <!>"))
      (princ))
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  5. #5
    Super Member skipsophrenic's Avatar
    Computer Details
    skipsophrenic's Computer Details
    Operating System:
    Vista 32 bit
    Computer:
    Compaq
    Motherboard:
    erm . . yeah?
    CPU:
    Intel Pentium Dual CPU E2140 @ 1.60 Ghz
    RAM:
    2039MB
    Graphics:
    don't ask you'll kill me
    Primary Storage:
    360gb
    Monitor:
    21" widescren - 16:10 ratio
    Using
    AutoCAD 2008
    Join Date
    Jul 2008
    Location
    Birmingham, United Kingdom
    Posts
    1,020

    Default

    Thanks 4 the tips - i'll try them tomorraz when I get to work
    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein

    SET FILEDIA = 1

  6. #6
    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
    16,619

    Default

    Good stuff, let me know how you get on
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  7. #7
    Super Member skipsophrenic's Avatar
    Computer Details
    skipsophrenic's Computer Details
    Operating System:
    Vista 32 bit
    Computer:
    Compaq
    Motherboard:
    erm . . yeah?
    CPU:
    Intel Pentium Dual CPU E2140 @ 1.60 Ghz
    RAM:
    2039MB
    Graphics:
    don't ask you'll kill me
    Primary Storage:
    360gb
    Monitor:
    21" widescren - 16:10 ratio
    Using
    AutoCAD 2008
    Join Date
    Jul 2008
    Location
    Birmingham, United Kingdom
    Posts
    1,020

    Default

    Will do - won't be untill afternoon tho - am at limb centre in mornin gettin me new leg (Hopefully)
    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein

    SET FILEDIA = 1

  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
    16,619

    Default

    Quote Originally Posted by skipsophrenic View Post
    Will do - won't be untill afternoon tho - am at limb centre in mornin gettin me new leg (Hopefully)
    Its not everyday you get to say that now is it...
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  9. #9
    Super Member skipsophrenic's Avatar
    Computer Details
    skipsophrenic's Computer Details
    Operating System:
    Vista 32 bit
    Computer:
    Compaq
    Motherboard:
    erm . . yeah?
    CPU:
    Intel Pentium Dual CPU E2140 @ 1.60 Ghz
    RAM:
    2039MB
    Graphics:
    don't ask you'll kill me
    Primary Storage:
    360gb
    Monitor:
    21" widescren - 16:10 ratio
    Using
    AutoCAD 2008
    Join Date
    Jul 2008
    Location
    Birmingham, United Kingdom
    Posts
    1,020

    Default

    Only once a year! LOL
    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein

    SET FILEDIA = 1

  10. #10
    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
    16,619

    Default

    Registered forum members do not see this ad.

    Alternatively, this will unlock all layers before performing the flatten:

    Code:
    (defun c:flat  (/ laylst ss ssObj j)
      (vl-load-com)
      (vlax-for lay
             (vla-get-layers
               (vla-get-ActiveDocument
                 (vlax-get-acad-object)))
        (setq laylst (cons lay laylst)))
      (mapcar '(lambda (l) (vla-put-lock l :vlax-false)) laylst)
      (if (setq ss (ssget "X"
                  (list (if    (getvar "CTAB")
                      (cons 410 (getvar "CTAB"))
                      (cons 67 (- 1 (getvar "TILEMODE")))))))
        (progn
          (setq ssObj (mapcar 'vlax-ename->vla-object
                  (mapcar 'cadr (ssnamex ss))) j 0)
          (foreach Obj  ssObj
        (foreach n  '(1e99 -1e99)
          (if (vl-catch-all-error-p
            (vl-catch-all-apply
              '(lambda (x)
                 (vla-move x (vlax-3d-point (list 0 0 0))
                       (vlax-3d-point (list 0 0 n))))
              (list Obj)))
            nil (setq j (1+ j)))))
          (princ (strcat "\n" (rtos (/ j 2.0)) " Objects Flattened.")))
        (princ "\n<!> No Objects Found <!>"))
      (princ))
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

Similar Threads

  1. Ceiling Grid lisp not working right
    By cadmando2 in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 27th Feb 2009, 04:51 pm
  2. Printing lisp Stopped Working
    By Absntmind in forum AutoLISP, Visual LISP & DCL
    Replies: 10
    Last Post: 29th Aug 2008, 04:09 pm
  3. Flatten and Convert to Schematic Line... Macro, Lisp?
    By xspacex in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 23rd Mar 2008, 07:32 am
  4. Arcarrow lisp not working
    By JeepMaster in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 3rd Jan 2008, 08:19 pm
  5. Lisp Routines Not Working in Current USC
    By GMANSQUARE in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 13th Aug 2007, 10:22 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