Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/27/2019 in all areas

  1. Like Remark a good point to show what you have done. Explain the time savings. Be careful if you open the code to show them, dont use the ones with 200 lines of code or you will lose them, you may want to explain the simple stuff 1st, like the gets, getpoint getreal getstring etc, ssget how it allows multiple selections and part 2 that you can add filters like a layer or an object type. Important is simple stuff like Polar how to calculate other points and using it to draw objects. How to entget pulling out the properties or use vla-get-xxxxxx Could you provide some insight into what you have done, simple to complex don't need code, maybe a few of us can guess which to start with as learning examples. I had the same problem 8 direct staff plus the other floors, trying to just get them interested was so hard I would cringe watching some things they would do just repeating over and over. I have attended many staff improvement sessions and one of the suggestions I took away was if your proposing a Lunch session, go around the table asking for one idea from each, the important thing is do not go to the next person till they give you a improvement idea. Or go back to them if its just to hard. Just try it, it may not be successful but if you go away with one idea then it has worked and look at doing that task with that person. We are here to help. You can document code with a comment on basicly every line to help understand whats going on. Oh yeah explain can be menu driven.
    1 point
  2. Why does the LISP have to be recursive? Give this a try: ;; Text 2 Point - Lee Mac 2012 ;; Prompts for a selection of Text and Point entities and moves ;; each Text entity to the nearest (2D distance) Point entity in the set. ;; ;; Retains existing Text elevation. (defun c:txt2pt ( / _textinsertion di1 di2 dxf ent inc ins lst mpt pnt sel txt ) (defun _textinsertion ( elist ) (if (and (zerop (cdr (assoc 72 elist))) (zerop (cdr (assoc 73 elist))) ) (cdr (assoc 10 elist)) (cdr (assoc 11 elist)) ) ) (if (setq sel (ssget "_:L" '((0 . "POINT,TEXT")))) (progn (repeat (setq inc (sslength sel)) (setq ent (entget (ssname sel (setq inc (1- inc))))) (if (eq "POINT" (cdr (assoc 0 ent))) (setq lst (cons (cdr (assoc 10 ent)) lst)) (setq txt (cons (cons (_textinsertion ent) ent) txt)) ) ) (foreach ent txt (setq ins (list (caar ent) (cadar ent))) (if (setq pnt (vl-some '(lambda ( pnt ) (equal ins (list (car pnt) (cadr pnt)) 1e-8)) lst)) (setq lst (vl-remove pnt lst)) (progn (setq di1 (distance ins (list (caar lst) (cadar lst))) mpt (car lst) ) (foreach pnt (cdr lst) (if (< (setq di2 (distance ins (list (car pnt) (cadr pnt)))) di1) (setq di1 di2 mpt pnt ) ) ) (setq pnt (list (car mpt) (cadr mpt) (caddar ent)) dxf (cdr ent) dxf (subst (cons 10 pnt) (assoc 10 dxf) dxf) dxf (subst (cons 11 pnt) (assoc 11 dxf) dxf) ) (entmod dxf) (setq lst (vl-remove mpt lst)) ) ) ) ) ) (princ) ) (vl-load-com) (princ) It will prompt for a selection of Text and Point entities and move each Text entity to the nearest Point entity (nearest by 2D distance), unless a Point is already found with equal X/Y coords as the Text entity. The program will retain the existing elevation of the Text entity. Example: It's probably not the most efficient routine, but I don't have time study a better algorithm.
    1 point
×
×
  • Create New...