Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/31/2023 in all areas

  1. Busy day today but my solution is just shooting whoever gave you a drawing with lines at the wrong levels? Would that work as a lesson for them? A lot of my work is 2d and so I'd be tempted to set the axis for both to be the same (remembering the original draughter has just been shot, have to do it myself). If you need it to join from one 'z''; level to another you might need a temporary construction line to make the fillet (or some maths), rotate the view, rotate the fillet from horizontal and join the ends to the upper line. Yup a LISP for that. However a busy day, there is a cake in the oven , one to look at later if that's what you want
    1 point
  2. See if you like this. It's only for LINES. It can be expanded to work for more types of elements, but that would complicate it. You select the two lines, then you need to pick 1 point: this point sets the elevation for the end result. The code sets all 4 endpoints to that elevation (Z-position) Then a standard fillet is done. (defun drawLine (p1 p2) (entmakex (list (cons 0 "LINE") (cons 10 p1) (cons 11 p2)))) ;; FNC for fillet Non Colinear (defun c:fnc ( / obj1 obj2 elvp elv p1 p2 p3 p4 p1_ p2_ p3_ p4_ ) (setq obj1 (car (nentsel "\nLine1: "))) (setq obj2 (car (nentsel "\nLine2: "))) (setq elvp (getpoint "\nSelect a point for the elevation: ")) ;; endpoints (setq p1 (cdr (assoc 10 (entget obj1))) p2 (cdr (assoc 11 (entget obj1))) p3 (cdr (assoc 10 (entget obj2))) p4 (cdr (assoc 11 (entget obj2))) elv (if (nth 2 elvp) (nth 2 elvp) 0.0) ) ;; endpoints, but all on the same elevation (setq p1_ (list (nth 0 p1) (nth 1 p1) elv) p2_ (list (nth 0 p2) (nth 1 p2) elv) p3_ (list (nth 0 p3) (nth 1 p3) elv) p4_ (list (nth 0 p4) (nth 1 p4) elv) ) ;; let's put the elevation of the lines even (entmod (subst (cons 10 p1_) (assoc 10 (entget obj1)) (entget obj1) )) (entmod (subst (cons 11 p2_) (assoc 11 (entget obj1)) (entget obj1) )) (entmod (subst (cons 10 p3_) (assoc 10 (entget obj2)) (entget obj2) )) (entmod (subst (cons 11 p4_) (assoc 11 (entget obj2)) (entget obj2) )) (command "_fillet" obj1 obj2) (princ) )
    1 point
  3. The two lines in your sample drawing are very close to be coplanar. A lisp program could define a ucs via 3 points (the two ends of one line and one end of the other line) and then use flatten to yield two lines that could be filleted. Would this be acceptable?
    1 point
  4. oh, my mistake thank you for help
    1 point
  5. At first glance ... You got this line twice, 1st time in the error function, then at towards the end of the function: (command "-LAYDEL" "Name" "Conduit_Offset_Temp" "" "Yes") All the temporary circles are drawn in that layer. So then at the end you delete that layer and anything drawn on it. The problem: you can't delete a layer that is set current. First you need to switch layer, for example to layer "0" So do this around line 132: (setvar 'clayer "0") (command "-LAYDEL" "Name" "Conduit_Offset_Temp" "" "Yes") Again, that's just at first glance, if this doesn't help I can see more thoroughly
    1 point
  6. Just a quick look at the code, if ss nil is a problem then add to the IF another progn for SS is not nil this is the way I do it even in big code. (if (= ss nil) (progn ;;(new_dialog "CalculateLengths10" dcl_id) (set_tile "error" "Nije pronadjen ni jedan objekat debljine d=0.10 m!") ;;(start_dialog) (princ) ) (progn lots of code dcl lengths etc ) ; end of big code progn ) ; end of if ss nil ) ; maybe end of defun execute
    1 point
  7. There is a lot of list manipulation examples in the Challenges section of the swamp similar to what you were looking for worth having a look.
    1 point
  8. That's pretty impressive for just starting Tho I assume you had some help from ChatGPT with how some of those variables are named. The problem looks like the lisp is only checking the variable SS and with a dialog box i guess you would have to close and open it again to allow the user to make a selection. this code would loop until a selection set ss is set. down side is you would either have to make a selection or hit esc to exit loop. ;;Execute button (defun execute () (if (= flag 4) (progn (prompt "\nSelektujte linijske objekte za proracun ukupne duzine") ;adding "/n" in string is telling autocad to start newline (if ss (load_dialog dcl_id) ;do nothing (progn (unload_dialog dcl_id) (prompt "\nNišta nije odabrano pokušaj ponovno") (setq ss (ssget '((0 . "INSERT,*POLYLINE,LINE,ARC,SPLINE")))) (execute) to test SS again ) ) .... I would suggest having another button next to Execute like "Make Selection" or something. That way you can modify the selection without having to exiting the lisp and starting over. Also these are the same. (setq ss (ssget '((-4 . "<or") (0 . "INSERT,POLYLINE,LWPOLYLINE,LINE,ARC,SPLINE") (-4 . "or>")))) (setq ss (ssget '((0 . "INSERT,*POLYLINE,LINE,ARC,SPLINE"))))
    1 point
  9. (if (zerop (getvar "USERR1")) (setvar "USERR1" 25.0) ) (initget 6) (setq pipesize (getreal (strcat "\nSpecify the pipesize <" (vl-princ-to-string (getvar "USERR1"))"> : "))) (if (not pipesize) (setq pipesize (getvar "USERR1")) (setvar "USERR1" pipesize))
    1 point
  10. Some time ago, while assisting another student I asked if they could share a copy of the project PDF file with me and the student emailed me a copy. But that was in 2011. So, going back to what I said previously, I don't know if the project instructions remained the same or were updated. I do know that Penn-Foster updated the project instructions for the Oleson Village project after I pointed out errors, omissions and misinformation in the text.
    1 point
  11. I see you already have the solution from another Forum. They must wake up earlier than this one!!
    1 point
×
×
  • Create New...