Lisp Polylinienende einen Block einfügen und auf die Linie ausrichten

Lisp Polylinienende einen Block einfügen und auf die Linie ausrichten

C.Utzinger
Collaborator Collaborator
1,594 Views
13 Replies
Message 1 of 14

Lisp Polylinienende einen Block einfügen und auf die Linie ausrichten

C.Utzinger
Collaborator
Collaborator

Hallo miteinander

 

Ich habe folgendes Problem:

 

Wie kann ich beim ENDE den Block auf die letzte Polylinie ausrichten (momentan steht da "0")

 

(defun c:<Test()
 (setq START(getpoint "\nStart: "))
 (setq MP1 (getpoint START "\nMP1: "))
 (command "_pline" START MP1 (while (/=(getvar "CMDACTIVE")0)(command pause)))
 (setq ENDE (getvar "Lastpoint"))
 (command "_-insert" "spi-bew-pfeil" START "12.5" "12.5" MP1)
 (command "_-insert" "spi-bew-pfeil" ENDE "12.5" "12.5" "0")(prin1)
) ;_ end of defun

 

 

Schöne Grüsse

Christian

0 Likes
1,595 Views
13 Replies
Replies (13)
Message 2 of 14

cadwomen
Collaborator
Collaborator

Hallo

 

darin sollte die Lösung enthalten sein

 

  1. ;;--------------------=={ Object Align }==--------------------;;
  2. ;;                                                            ;;
  3. ;;  This program will enable the user to dynamically align a  ;;
  4. ;;  selection of objects to a selected curve, with intuitive  ;;
  5. ;;  placement controls.                                       ;;
  6. ;;                                                            ;;
  7. ;;  Upon starting the program with the command syntax 'OA',   ;;
  8. ;;  the user is prompted to make a selection of objects to    ;;
  9. ;;  be aligned. Following a valid selection, the user is      ;;
  10. ;;  prompted to specify a base point to use during alignment; ;;
  11. ;;  at this prompt, the program will use the center of the    ;;
  12. ;;  bounding box of the selection of objects by default.      ;;
  13. ;;                                                            ;;
  14. ;;  The user is then prompted to select a curve object        ;;
  15. ;;  (this may be a Line, Polyline, Arc, Circle, Ellipse,      ;;
  16. ;;  XLine, Spline etc.) to which the objects are to be        ;;
  17. ;;  aligned. The selected curve may be a primary object, or   ;;
  18. ;;  nested with a Block or XRef to any level. After           ;;
  19. ;;  selection, the program offers several controls to aid     ;;
  20. ;;  with object placement displayed at the command line:      ;;
  21. ;;                                                            ;;
  22. ;;  [+/-] for [O]ffset | [</>] for [R]otation | <[E]xit>:     ;;
  23. ;;                                                            ;;
  24. ;;  The offset of the objects from the curve may be           ;;
  25. ;;  controlled incrementally by a tenth of the object height  ;;
  26. ;;  using the '+' / '-' keys, or a specific offset may be     ;;
  27. ;;  entered upon pressing the 'O' or 'o' key.                 ;;
  28. ;;                                                            ;;
  29. ;;  The set of objects may be rotated anti-clockwise or       ;;
  30. ;;  clockwise by 45 degrees relative to the curve by pressing ;;
  31. ;;  the '<' or '>' keys respectively; alternatively, the user ;;
  32. ;;  may enter a specific rotation by pressing the 'R' or 'r'  ;;
  33. ;;  key.                                                      ;;
  34. ;;                                                            ;;
  35. ;;  Finally, the user may place the objects and exit the      ;;
  36. ;;  program by either clicking the left or right mouse        ;;
  37. ;;  buttons, pressing Enter or Space, or by pressing the 'E'  ;;
  38. ;;  or 'e' keys.                                              ;;
  39. ;;                                                            ;;
  40. ;;  The program should perform successfully in all UCS &      ;;
  41. ;;  Views, and in all versions of AutoCAD that have Visual    ;;
  42. ;;  LISP functions available (AutoCAD 2000 onwards).          ;;
  43. ;;                                                            ;;
  44. ;;------------------------------------------------------------;;
  45. ;;  Author: Lee Mac, Copyright © 2012 - www.lee-mac.com       ;;
  46. ;;------------------------------------------------------------;;
  47. ;;  Version 1.3    -    14-12-2012                            ;;
  48. ;;------------------------------------------------------------;;
  49.  
  50. (defun c:oa
  51.  
  52.     (
  53.         /
  54.         *error*
  55.         _copynested
  56.         _curveobject-p
  57.         _fixdxfdata
  58.         _locked-p
  59.         _selectif
  60.  
  61.         bb1 bb2 blk bnm bpt
  62.         def dis
  63.         enl ent
  64.         fac
  65.         gr1 gr2
  66.         inc
  67.         llp lst
  68.         mat msg
  69.         nrm
  70.         obj
  71.         pi2 pt1 pt2
  72.         sel
  73.         tmp
  74.         urp uxa
  75.     )
  76.  
  77.     (defun *error* ( msg )
  78.         (if (and
  79.                 (= 'list  (type mat))
  80.                 (= 'ename (type ent))
  81.             )
  82.             (entdel ent)
  83.         )
  84.         (if (and (= 'vla-object (type blk)) (not (vlax-erased-p blk)))
  85.             (vl-catch-all-apply 'vla-delete (list blk))
  86.         )
  87.         (if (and (= 'vla-object (type def)) (not (vlax-erased-p def)))
  88.             (vl-catch-all-apply 'vla-delete (list def))
  89.         )
  90.         (foreach obj lst
  91.             (if (not (vlax-erased-p obj))
  92.                 (vl-catch-all-apply 'vla-delete (list obj))
  93.             )
  94.         )
  95.         (LM:endundo (LM:acdoc))
  96.         (if (and msg (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")))
  97.             (princ (strcat "\nError: " msg))
  98.         )
  99.         (princ)
  100.     )
  101.     
  102.     (defun _curveobject-p ( ent )
  103.         (null
  104.             (vl-catch-all-error-p
  105.                 (vl-catch-all-apply 'vlax-curve-getendparam (list ent))
  106.             )
  107.         )
  108.     )
  109.  
  110.     (defun _fixdxfdata ( elst )
  111.         (vl-remove-if '(lambda ( pair ) (member (car pair) '(5 6 8 102 330))) elst)
  112.     )
  113.  
  114.     (defun _copynested ( ent mat / enx )
  115.         (if
  116.             (setq ent
  117.                 (cond
  118.                     (   (= "VERTEX" (cdr (assoc 0 (setq enx (entget ent)))))
  119.                         (entmakex (_fixdxfdata (entget (setq ent (cdr (assoc 330 enx))))))
  120.                         (setq ent (entnext ent)
  121.                               enx (entget  ent)
  122.                         )
  123.                         (while (/= "SEQEND" (cdr (assoc 0 enx)))
  124.                             (entmakex (_fixdxfdata enx))
  125.                             (setq ent (entnext ent)
  126.                                   enx (entget  ent)
  127.                             )
  128.                         )
  129.                         (cdr (assoc 330 (entget (entmakex (_fixdxfdata enx)))))
  130.                     )
  131.                     (   (entmakex (_fixdxfdata enx))   )
  132.                 )
  133.             )
  134.             (if mat (vla-transformby (vlax-ename->vla-object ent) (vlax-tmatrix mat)))
  135.         )
  136.         ent
  137.     )
  138.  
  139.     (defun _selectif ( msg pred )
  140.         (
  141.             (lambda ( pred / sel )
  142.                 (while
  143.                     (progn (setvar 'errno 0) (setq sel (nentselp msg))
  144.                         (cond
  145.                             (   (= 7 (getvar 'errno))
  146.                                 (princ "\nMissed, try again.")
  147.                             )
  148.                             (   (= 'ename (type (car sel)))
  149.                                 (if (null (pred (car sel)))
  150.                                     (princ "\nInvalid Object Selected.")
  151.                                 )
  152.                             )
  153.                         )
  154.                     )
  155.                 )
  156.                 sel
  157.             )
  158.             (eval pred)
  159.         )
  160.     )
  161.     
  162.     (defun _locked-p ( layer )
  163.         (= 4 (logand 4 (cdr (assoc 70 (tblsearch "LAYER" layer)))))
  164.     )
  165.  
  166.     (if (null oa|rot)
  167.         (setq oa|rot 0.0)
  168.     )
  169.     (if (null oa|off)
  170.         (setq oa|off 0.0)
  171.     )
  172.     (cond
  173.         (   (or
  174.                 (_locked-p (getvar 'clayer))
  175.                 (_locked-p "0")
  176.             )
  177.             (princ "\nCurrent Layer or Layer \"0\" locked.")
  178.         )
  179.         (   (null (setq sel (LM:ssget "\nSelect Objects to Align: " '("_:L" ((0 . "~VIEWPORT"))))))
  180.             (princ "\n*Cancel*")
  181.         )
  182.         (   (progn
  183.                 (setq mat
  184.                     (vlax-tmatrix
  185.                         (append
  186.                             (mapcar
  187.                                '(lambda ( a b ) (append (trans a 1 0 t) (list b)))
  188.                                '(
  189.                                     (1.0 0.0 0.0)
  190.                                     (0.0 1.0 0.0)
  191.                                     (0.0 0.0 1.0)
  192.                                 )
  193.                                 (trans '(0.0 0.0 0.0) 0 1)
  194.                             )
  195.                            '((0.0 0.0 0.0 1.0))
  196.                         )
  197.                     )
  198.                 )
  199.                 (LM:startundo (LM:acdoc))
  200.                 (repeat (setq inc (sslength sel))
  201.                     (setq obj (vla-copy (vlax-ename->vla-object (ssname sel (setq inc (1- inc)))))
  202.                           lst (cons obj lst)
  203.                     )
  204.                     (vla-transformby obj mat)
  205.                     (if (and (vlax-method-applicable-p obj 'getboundingbox)
  206.                             (not
  207.                                 (vl-catch-all-error-p
  208.                                     (vl-catch-all-apply 'vla-getboundingbox (list obj 'llp 'urp))
  209.                                 )
  210.                             )
  211.                         )
  212.                         (setq bb1 (cons (vlax-safearray->list llp) bb1)
  213.                               bb2 (cons (vlax-safearray->list urp) bb2)
  214.                         )
  215.                     )
  216.                     (vla-put-visible obj :vlax-false)
  217.                 )
  218.                 (setq bb1 (apply 'mapcar (cons 'min bb1))
  219.                       bb2 (apply 'mapcar (cons 'max bb2))
  220.                 )
  221.                 (cond
  222.                     (   (setq bpt (getpoint "\nSpecify Base Point <Center>: "))
  223.                         (setq bpt (trans bpt 1 0))
  224.                     )
  225.                     (   (setq bpt (mapcar (function (lambda ( a b ) (/ (+ a b) 2.0))) bb1 bb2)))
  226.                 )
  227.                 (null
  228.                     (setq enl
  229.                         (_selectif "\nSelect Curve: "
  230.                             (function
  231.                                 (lambda ( x )
  232.                                     (or (= "VERTEX" (cdr (assoc 0 (entget x)))) (_curveobject-p x))
  233.                                 )
  234.                             )
  235.                         )
  236.                     )
  237.                 )
  238.             )
  239.             (*error* nil)
  240.         )
  241.         (   (not
  242.                 (or
  243.                     (and
  244.                         (setq mat (caddr enl))
  245.                         (setq ent (_copynested (car enl) mat))
  246.                     )
  247.                     (and
  248.                         (= "VERTEX" (cdr (assoc 0 (entget (car enl)))))
  249.                         (setq ent (cdr (assoc 330 (entget (car enl)))))
  250.                     )
  251.                     (setq ent (car enl))
  252.                 )
  253.             )
  254.             (*error* nil)
  255.             (princ "\nUnable to Recreate Nested Entity.")
  256.         )
  257.         (   t         
  258.             (setq pt1 (cadr (grread t 9))
  259.                   fac (/ (- (cadr bb2) (cadr bb1)) 2.0)
  260.                   nrm (trans '(0.0 0.0 1.0) 1 0 t)
  261.                   uxa (angle '(0.0 0.0 0.0) (trans (getvar 'ucsxdir) 0 nrm t))
  262.                   pi2 (/ pi -2.0)
  263.             )
  264.             (setq inc 0)
  265.             (while (tblsearch "BLOCK" (setq bnm (strcat "$tmp" (itoa (setq inc (1+ inc)))))))
  266.             (foreach obj lst (vla-put-visible obj :vlax-true))
  267.             (vla-copyobjects (LM:acdoc)
  268.                 (vlax-make-variant
  269.                     (vlax-safearray-fill
  270.                         (vlax-make-safearray vlax-vbobject (cons 0 (1- (length lst))))
  271.                         lst
  272.                     )
  273.                 )
  274.                 (setq def (vla-add (vla-get-blocks (LM:acdoc)) (vlax-3D-point bpt) bnm))
  275.             )
  276.             (foreach obj lst (vla-delete obj))
  277.             (setq lst nil)
  278.          
  279.             (setq blk
  280.                 (vla-insertblock
  281.                     (vlax-get-property (LM:acdoc) (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace))
  282.                     (vlax-3D-point (trans pt1 1 0))
  283.                     bnm
  284.                     1.0 1.0 1.0 0.0
  285.                 )
  286.             )
  287.             (vla-put-layer blk "0")
  288.             (vla-put-normal blk (vlax-3D-point nrm))
  289.             (setq msg (princ "\n[+/-] for [O]ffset | [</>] for [R]otation | <[E]xit>: "))
  290.  
  291.             (while
  292.                 (progn
  293.                     (setq gr1 (grread t 15 0)
  294.                           gr2 (cadr gr1)
  295.                           gr1 (car  gr1)
  296.                     )
  297.                     (cond
  298.                         (   (member gr1 '(3 5))
  299.                             (setq pt2 (trans gr2 1 0)
  300.                                   pt1 (vlax-curve-getclosestpointto ent pt2)
  301.                             )
  302.                             (if (not (equal pt1 pt2 1e-8))
  303.                                 (progn
  304.                                     (setq dis (/ (* fac oa|off) (distance pt1 pt2)))
  305.                                     (vla-put-insertionpoint blk (vlax-3D-point (mapcar '(lambda ( a b ) (+ a (* (- b a) dis))) pt1 pt2)))
  306.                                     (vla-put-rotation blk (+ (angle (trans pt1 0 1) gr2) uxa oa|rot pi2))
  307.                                 )
  308.                             )
  309.                             (= 5 gr1)
  310.                         )
  311.                         (   (= 2 gr1)
  312.                             (cond
  313.                                 (   (member gr2 '(043 061))
  314.                                     (setq oa|off (+ oa|off 0.1))
  315.                                 )
  316.                                 (   (member gr2 '(045 095))
  317.                                     (setq oa|off (- oa|off 0.1))
  318.                                 )
  319.                                 (   (member gr2 '(044 060))
  320.                                     (setq oa|rot (+ oa|rot (/ pi 4.0)))
  321.                                 )
  322.                                 (   (member gr2 '(046 062))
  323.                                     (setq oa|rot (- oa|rot (/ pi 4.0)))
  324.                                 )
  325.                                 (   (member gr2 '(013 032 069 101))
  326.                                     nil
  327.                                 )
  328.                                 (   (member gr2 '(082 114))
  329.                                     (if (setq tmp (getangle (strcat "\nSpecify Rotation <" (angtos oa|rot) ">: ")))
  330.                                         (setq oa|rot tmp)
  331.                                     )
  332.                                     (princ msg)
  333.                                 )
  334.                                 (   (member gr2 '(079 111))
  335.                                     (if (setq tmp (getdist (strcat "\nSpecify Offset <" (rtos (* fac oa|off)) ">: ")))
  336.                                         (setq oa|off (/ tmp fac))
  337.                                     )
  338.                                     (princ msg)
  339.                                 )
  340.                                 (   t   )
  341.                             )
  342.                         )
  343.                         (   (member gr1 '(011 025))
  344.                             nil
  345.                         )
  346.                         (   t   )
  347.                     )
  348.                 )
  349.             )
  350.             (if mat (entdel ent))
  351.             (vla-explode blk)
  352.             (vla-delete  blk)
  353.             (vla-delete  def)
  354.             (LM:endundo (LM:acdoc))
  355.         )
  356.     )
  357.     (princ)
  358. )
  359.  
  360. ;; ssget  -  Lee Mac
  361. ;; A wrapper for the ssget function to permit the use of a custom selection prompt
  362. ;;
  363. ;; Arguments:
  364. ;; msg    - selection prompt
  365. ;; params - list of ssget arguments
  366.  
  367. (defun LM:ssget ( msg params / sel )
  368.     (princ msg)
  369.     (setvar 'nomutt 1)
  370.     (setq sel (vl-catch-all-apply 'ssget params))
  371.     (setvar 'nomutt 0)
  372.     (if (not (vl-catch-all-error-p sel)) sel)
  373. )
  374.  
  375. ;; Start Undo  -  Lee Mac
  376. ;; Opens an Undo Group.
  377.  
  378. (defun LM:startundo ( doc )
  379.     (LM:endundo doc)
  380.     (vla-startundomark doc)
  381. )
  382.  
  383. ;; End Undo  -  Lee Mac
  384. ;; Closes an Undo Group.
  385.  
  386. (defun LM:endundo ( doc )
  387.     (while (= 8 (logand 8 (getvar 'undoctl)))
  388.         (vla-endundomark doc)
  389.     )
  390. )
  391.  
  392. ;; Active Document  -  Lee Mac
  393. ;; Returns the VLA Active Document Object
  394.  
  395. (defun LM:acdoc nil
  396.     (eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object))))
  397.     (LM:acdoc)
  398. )
  399.     
  400. ;;------------------------------------------------------------;;
  401.  
  402. (vl-load-com)
  403. (princ
  404.     (strcat
  405.         "\n:: ObjectAlign.lsp | Version 1.3 | © Lee Mac "
  406.         (menucmd "m=$(edtime,$(getvar,DATE),YYYY)")
  407.         www.lee-mac.com ::"
  408.         "\n:: Type \"OA\" to Invoke ::"
  409.     )
  410. )
  411. (princ)
  412.  
  413. ;;------------------------------------------------------------;;
  414. ;;                         End of File                        ;;
  415. ;;------------------------------------------------------------;;

 

trift nicht exakt deine Aufgabenstellung , löst aber das Problem

 

cu cw

If my post answers your question, please mark it as an Accepted Solution, so that others can find answers quickly!
0 Likes
Message 3 of 14

ВeekeeCZ
Consultant
Consultant
Accepted solution

Try something like this.

I suggest to draw a polyline first, with a regular command. The run the routine which takes the last object drawn.

Never forget to turn off the OSNAPS before you set some point inside of command!! Blue

 

(vl-load-com)

(defun c:<Test ( / en start eng ende)
  (if (and (setq en (entlast))
           (wcmatch (cdr (assoc 0 (entget en))) "LWPOLYLINE,LINE,ARC")
           (setq start (vlax-curve-getStartPoint en))
           (setq ang (angle (trans '(0 0 0) 0 1) (trans (vlax-curve-getFirstDeriv en 0) 0 1)))
           (setq start (trans start 0 1))
           (setq ende (vlax-curve-getEndPoint en))
           (setq ende (trans ende 0 1))
           )
    (command "_-insert" "spi-bew-pfeil" "_scale" 12.5 "_r" (angtos ang) "_none" start
             "_-insert" "spi-bew-pfeil" "_scale" 12.5 "_r" 0 "_none" ende))
  (prin1)
) ;_ end of defun

 

BTW there is a special forum for customizations, HERE you'll get better response. Unfortunately in English only. But Google Translator can help. As did to me.

Message 4 of 14

C.Utzinger
Collaborator
Collaborator

Hi Beekee

 

Thank you for the code.

 

It works good. The Problem ist the rotation of the last Arrow is still 0, i need it in the direction of the last line. It's the same problem i have with my first code. 

 

Can you help me with that?

 

Regards

0 Likes
Message 5 of 14

ВeekeeCZ
Consultant
Consultant

You're welcome.
You had 0 in your code, so I figured that's what you want.

Anyway, you have a pattern... just try do that yourself.
See, I used (vlax-curve-getFirstDeriv en 0), 0 for a parameter, which is beginning of a curve. You need to get the parameter at the end - so use the (vlax-curve-getEndParam curve-obj) function. See HELP
Good luck!

0 Likes
Message 6 of 14

C.Utzinger
Collaborator
Collaborator

Hi

 

Thank you very much for your help. Unfortunately i'm not a informatician, i just draw Construction-Plans for buildings.

Half of the code you give me is like chinese for me :).

 

Please help with the code. because i'm lost ;).

 

Kind regards...

 

 

0 Likes
Message 7 of 14

ВeekeeCZ
Consultant
Consultant
Accepted solution

Neither am I. And most of us is not. It's not difficult, just basics. Anyway, have fun with your routine!

 

Spoiler
(vl-load-com)

(defun c:<Test ( / en start ang1 ang2 ende)
  (if (and (setq en (entlast))
           (wcmatch (cdr (assoc 0 (entget en))) "LWPOLYLINE,LINE,ARC")
           (setq start (vlax-curve-getStartPoint en))
           (setq ang1 (angle (trans '(0 0 0) 0 1) (trans (vlax-curve-getFirstDeriv en (vlax-curve-getStartParam en)) 0 1)))
           (setq start (trans start 0 1))
           (setq ende (vlax-curve-getEndPoint en))
           (setq ende (trans ende 0 1))
           (setq ang2 (angle (trans '(0 0 0) 0 1) (trans (vlax-curve-getFirstDeriv en (vlax-curve-getEndParam en)) 0 1)))
           )
    (command "_-insert" "spi-bew-pfeil" "_scale" 12.5 "_r" (angtos ang1) "_none" start
             "_-insert" "spi-bew-pfeil" "_scale" 12.5 "_r" (angtos ang2) "_none" ende))
  (prin1)
) ;_ end of fun

 

Message 8 of 14

C.Utzinger
Collaborator
Collaborator

Hi

 

Thank you very very very much.

 

Just a little problem i still have. This arrow at the end should turn 180° then it will be perfect.

 

 

Kind regards

0 Likes
Message 9 of 14

C.Utzinger
Collaborator
Collaborator

I have it thank you!!!!!!

0 Likes
Message 10 of 14

cadwomen
Collaborator
Collaborator

Hallo c.utzinger

 

dann Bitte hier noch die Lösung im ganzen Posten damit bei der Suche eines anderen Mitglieds diese auch erfolgreich ist

 

cu cw

If my post answers your question, please mark it as an Accepted Solution, so that others can find answers quickly!
0 Likes
Message 11 of 14

C.Utzinger
Collaborator
Collaborator
Accepted solution


(defun c:<Test ( / en start ang1 ang2 ende)
  (if (and (setq en (entlast))
           (wcmatch (cdr (assoc 0 (entget en))) "LWPOLYLINE,LINE,ARC")
           (setq start (vlax-curve-getStartPoint en))
           (setq ang1 (angle (trans '(0 0 0) 0 1) (trans (vlax-curve-getFirstDeriv en (vlax-curve-getStartParam en)) 0 1)))
           (setq start (trans start 0 1))
           (setq ende (vlax-curve-getEndPoint en))
           (setq ende (trans ende 0 1))
           (setq ang2 (angle (trans '(0 0 0) 0 1) (trans (vlax-curve-getFirstDeriv en (vlax-curve-getEndParam en)) 0 1)))
           )
    (command "_-insert" "spi-bew-pfeil" "_scale" 12.5 "_r" (angtos ang1) "_none" start
             "_-insert" "spi-bew-pfeil" "_scale" 12.5 "_r" (angtos ang2) "_none" ende))
  (prin1)
) ;_ end of fun

Message 12 of 14

C.Utzinger
Collaborator
Collaborator
Accepted solution

OH! Sorry! Taht is the final Version:

 

(defun c:<Verteillinie ( / en start ang1 ang2 ende)
           (command "_pline" (while (/=(getvar "CMDACTIVE")0)(command pause)))
  (if (and (setq en (entlast))
           (wcmatch (cdr (assoc 0 (entget en))) "LWPOLYLINE,LINE,ARC")
           (setq start (vlax-curve-getStartPoint en))
           (setq ang1 (angle (trans '(0 0 0) 0 1) (trans (vlax-curve-getFirstDeriv en (vlax-curve-getStartParam en)) 0 1)))
           (setq start (trans start 0 1))
           (setq ende (vlax-curve-getEndPoint en))
           (setq ende (trans ende 0 1))
           (setq ang2 (angle (trans '(0 0 0) 0 1) (trans (vlax-curve-getFirstDeriv en (vlax-curve-getEndParam en)) 0 1)))
           )
  (command "_-insert" "spi-bew-pfeil" "_scale" 12.5 "_r" (angtos ang1) "_none" start
             "_-insert" "spi-bew-pfeil" "_scale" 12.5 "_r" (angtos ang2) "_none" ende))
           (setq ende2 (getvar "Lastpoint"))
           (command "_rotate" "l" "" ende2 "180")
  (prin1)
) ;_ end of fun

 

Thanks to all of you!

Message 13 of 14

ВeekeeCZ
Consultant
Consultant
Accepted solution

Good that you've find you own solution!

 

BTW you could just reverse one line...

 

(setq ang2 (angle (trans '(0 0 0) 0 1)
(trans (vlax-curve-getFirstDeriv en (vlax-curve-getEndParam en)) 0 1)))

to
(setq ang2 (angle (trans (vlax-curve-getFirstDeriv en (vlax-curve-getEndParam en)) 0 1)
(trans '(0 0 0) 0 1)))

 

 

Spoiler
(setq ang2 (angle (trans (vlax-curve-getFirstDeriv en (vlax-curve-getEndParam en)) 0 1)
                             (trans '(0 0 0) 0 1)))

Read your PM. (left envelope in upper right corner of the page)

Marked solution could be unmarked in message Options.

Message 14 of 14

C.Utzinger
Collaborator
Collaborator

Hi

 

Thank you again!!!

 

I thought there is a simpler way to do it. I tried some, but it didn´t worked :P..

 

 

Kind regards

0 Likes