Combine 2 different Lisp together.

Combine 2 different Lisp together.

jyan2000
Advocate Advocate
1,022 Views
5 Replies
Message 1 of 6

Combine 2 different Lisp together.

jyan2000
Advocate
Advocate

Anyone could help me to combine these two Lisp file? (attached) 

 

1st Lisp (Align.lsp) is Aligns 3d shape on the flat surface.

2nd lisp  (Edge Flaps 74.lsp) is offseeting out 74. However, shortest lenght must be horizontal. (see test-1.dwg)

 

Regards 

Victor

0 Likes
1,023 Views
5 Replies
Replies (5)
Message 2 of 6

Sandervp
Advocate
Advocate

Hello jyan,

 

If I'm not wrong, this is the sollution:

 

(DEFUN C:3aa ( / wtxt1 )
  

(if (not align) (arxload "geom3d" T))
 

(SETQ SS1 (SSGET))
(SETQ PT1 (GETPOINT "\nPick 1st Source Point (0,0)")
       PT2 (GETPOINT "\nPick 2nd Source Point (1,0)")
       PT3 (GETPOINT "\nPick 3rd Source Point (0,1)")
       D1 (LIST 0.0 0.0 0.0)
       D2 (LIST 1.0 0.0 0.0)
       D3 (LIST 0.0 1.0 0.0)
 )

 (ALIGN SS1 PT1 D1 PT2 D2 PT3 D3)

(command "explode" "all")
  
(setvar "peditaccept" 0)
(command ".pedit" "m" "all" "" "y" "j" "0" "")
(command "zoom" "e")
(setvar "CMDECHO" 0)
(setvar "clayer" "0")
(setvar "celtype" "bylayer")
(setvar "CECOLOR" "bylayer")
(setvar "CELWEIGHT" -1)
(princ)
)

(defun C:EF74 ; = Edge Flaps at 74 units wide
  (/ getpt plsel pl1 pl2 par1 par2)
  (defun getpt (pl par)
    (vlax-curve-getPointAtParam pl par)
  ); defun
  (if (setq plsel (entsel "\nSelect straight-edged Polyline to add edge flaps: "))
    (progn ; then
      (setvar 'offsetgaptype 1); to Offset with filleted arc-segment corners
      (setvar 'osmode 0); turn off Object Snap
      (setvar 'plinewid 0); just in case
(setvar 'clayer (cdr (assoc 8 (entget (car plsel))))); add
      (setq pl1 (vlax-ename->vla-object (car plsel)))
      (vla-offset pl1 74)
      (if (< (vla-get-area (vlax-ename->vla-object (entlast))) (vla-get-area pl1))
        ; went inboard?
        (progn ; then
          (entdel (entlast)); delete that one
          (vla-offset pl1 -74); go the other way
        ); progn
      ); if
      (setq
        pl2 (entlast)
        par1 -1.0
        par2 -1.0
      ); setq
      (command "_.pline")
      (repeat (fix (vlax-curve-getEndParam pl1))
        (command
          (getpt pl1 (setq par1 (1+ par1)))
          (getpt pl2 (setq par2 (1+ par2)))
          (getpt pl2 (setq par2 (1+ par2)))
        ); command
      ); repeat
      (command "_close")
(command "layer" "m" "hidden" "c" "8" "" "L" "hidden" "" "")
(vla-put-Layer pl1 "hidden"); add
      (vla-put-LinetypeScale pl1 11.0)
      (entdel pl2)
    ); progn [then]
  ); if
  (princ)
); defun



(DEFUN C:NEWCOMMAND;
  (C:3AA)
  (C:EF74)
  (princ)
)

 

Greetings from Holland

0 Likes
Message 3 of 6

jyan2000
Advocate
Advocate

Hi,

Thank you very much for your reply. But, it didn't really give the result what I've been searching. (attached image )

0 Likes
Message 4 of 6

Sandervp
Advocate
Advocate

Hi Jyan

 

And if you switch your lisp commands?

 

 

(DEFUN C:NEWCOMMAND;
  (C:EF74)
  (C:3AA)
  (princ)
)

 

 

I've got a problem with opening a DWG file in Internet Explorer 10. It's opening a new empty tab, it doesn't download the dwg file. So I can't see your drawing and try the lisp.

0 Likes
Message 5 of 6

jyan2000
Advocate
Advocate

I'm attaching again as ACAD 2000 format.  Or should I email ? 

 

0 Likes
Message 6 of 6

Sandervp
Advocate
Advocate

Thanks but the problem is the Internet Explorer...

 

I'm working with AutoCad 2016, that's should not be a problem

0 Likes