Jump to content

Line Drawing in the Lot(Linie im Lot)


dober

Recommended Posts

Can I help the defense Lisp to do better

If I measure from right to left, the line is set incorrectly. (See drawing)

Need help

Thank you

 

Kann mir wehr helfen das Lisp besser zu machen

Wenn ich von Rechts nach Links messe wird die linie falsch gesetzt.(siehe Zeichnung)

Brauche Hilfe

Danke

 

(defun C:RW_2P (/   punkt1 punkt2 punkt3 winkel1 winkel2 streck
             ) ;Ermitteln der aktuellen Systemvariablen
 (setvar "CMDECHO" 0)
 (setq c_layer (getvar "clayer"))
 (command "-layer" "ma" "_Bemhilfe" "fa" "200" "" "") 
 (initget 1)
 (setq
   punkt1
    (getpoint "\n1. Punkt der Basislinie picken: ")
 )       ;Setzen der Systemvariablen ORTHOMODE auf den Wert 0
 (initget 1)
 (setq punkt2 (getpoint punkt1 " und 2. Punkt der Basislinie picken: "))
         ;Rückstellen des ursprünglichen Wertes der Systemvariable OSMODE
 (initget 1)
 (setq streck (getreal "\nLänge der rechtwinkligen Linie eingeben: "))
 (setq winkel1 (angle punkt1 punkt2))
 (setq winkel2 (/ (* (+ (/ (* winkel1 180 ) pi) 90) pi) 180) )
 (setq punkt3  (polar punkt2 winkel2 streck))
 (command "_line" punkt3 punkt2 "")
 (setvar "clayer" C_layer)
) ;_ Ende von defun

lot.jpg

Link to comment
Share on other sites

Na ja ..der mit angle ermittelte Winkel der Basislinie ist ja auch von der Reihenfolge der Klickpunkte abhängig: 0° von links nach rechts sind 180° von rechts nach links.... vielleicht solltest du auch noch die Seite wählen lassen, auf welche die linie gezeichnet werden soll ?!

 

P.S. für LOT eignet sich auch sehr gut die Erste ableitung der Vlax-curve-funktion :


(defun c:LOT(/ L1 P1 VL1 V1)
(if(and(setq L1 (entsel"\nKurve wählen:"))
(setq P1 (trans(cadr L1)1 0))
(setq VL1 (vlax-ename->vla-object (car L1)))
(setq V1(vlax-curve-getFirstDeriv
VL1
(vlax-curve-getParamatpoint VL1
(setq P1
(vlax-curve-GetClosestPointTo VL1 P1)
)
)
)
)
)
(progn
(entmake
(list
'(0 . "XLINE")
'(100 . "AcDbEntity")
'(67 . 0)
(cons 410 (getvar "CTAB"))
(cons 8 (getvar "CLAYER"))
'(62 . 1)
'(6 . "Continuous")
'(100 . "AcDbXline")
(cons 10 P1)
(cons 11 (list (cadr V1) (- 0 (car V1)) 0))
)
)
)
)
)
[/Code]

Link to comment
Share on other sites

Hello cadmium

 

Thanks for the Lisp

But I do not seek, the lisp is quite ok but I want a line to create a longer I provide.

And it schollte xref work with.

So a lot of the line is in a Xref PÜunkt then I see a line and share with a length that I can enter.

take measured the line straight to the.

many thanks

 

 

Hallo CADmium

 

Danke für das Lisp

Aber das suche ich nicht, das lisp ist so schon ganz ok aber ich will eine linie mit eine Länger erstellen die ich angebe.

Und es schollte auch mit xref funktionieren.

Also Lot von einen Linie die in einer Xref ist dann auf PÜunkt den ich zeige eine linie setzen mit einer Länge die ich eingeben kann.

nehme die Linie auch gleich zum bemassen.

vielen Dank

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...