Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/05/2024 in all areas

  1. On another of the various pictures posted, the tangent point of the R30 circle and the R2690 circle does not seem to be vertically below the centre of the R30 circle. Perhaps it is easier drawn in SolidWorks than AutoCAD. The constraint images are quite confusing and block vital parts of the linework image.
    1 point
  2. How do I know if it's the lowest point?
    1 point
  3. I use this (I don't know the author), maybe it will help: ;;; remove polyline segments that have 0 length (defun rh:del_dup_pts (lst fuzz / n_lst) (while (> (length lst) 1) (if (> (distance (car lst) (cadr lst)) fuzz) (setq n_lst (cons (car lst) n_lst))) (setq lst (cdr lst))) (setq n_lst (cons (car lst) n_lst)) (reverse n_lst) );end_defun (vl-load-com) (defun c:plz ( / *error* ss fuzz vtot cnt ent elst obj vlst vno nvno) (defun *error* ( msg ) (if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nAn Error : " msg " occurred."))) (princ) );_end_*error*_defun (setq ss (ssget '((0 . "LWPOLYLINE"))) fuzz 1.0e-4 vtot 0) (cond (ss (repeat (setq cnt (sslength ss)) (setq ent (ssname ss (setq cnt (1- cnt))) elst (entget ent) obj (vlax-ename->vla-object ent) vlst (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) elst)) vno (length vlst) );end_setq (cond ( (and (= :vlax-true (vlax-get-property obj 'closed)) (equal (car vlst) (last vlst) fuzz)) (setq vlst (rh:del_dup_pts (reverse (cdr (reverse vlst))) fuzz)) ) ( (and (= :vlax-false (vlax-get-property obj 'closed)) (equal (car vlst) (last vlst) fuzz)) (setq vlst (rh:del_dup_pts (reverse (cdr (reverse vlst))) fuzz)) (vlax-put-property obj 'closed :vlax-true) ) (t (setq vlst (rh:del_dup_pts vlst fuzz)) ) );end_cond (setq nvno (length vlst)) (vlax-put obj 'coordinates (apply 'append vlst)) (setq vtot (+ vtot (- vno nvno))) );end_repeat (princ (strcat "\n" (itoa vtot) " Nodes removed from " (itoa (sslength ss)) (if (> (sslength ss) 1) " Polylines" " Polyline"))) ) );end_cond (princ) );end_defun
    1 point
  4. You'll need change 'mtext' in that to something else in my example it was just to show where to test for it. Perhaps add in: (setq mtext (cdr (assoc 0 e))) ) somewhere and in your new if statement ((= d "2Curly") (if (= mtext "MTEXT") (setq f (strcat "\\{"f"\\}"))) (setq f (strcat "{"f"}")))
    1 point
  5. Nearly there, in the (setq f (strcat ...... ) line for { }, put in an if statement: ( if mtext (setq f (strcat "//{"... (setq f (strcat "{"... ) you'll have to look at the syntax for the if statement perhaps using the entity DFX codes and assoc value 0
    1 point
  6. Not sure, but have you tried : Instead : (vla-put-activeviewport d vla) This : (vla-put-activepviewport d vla)
    1 point
  7. I thought I posted this yesterday Use (chr but imply by using "\" for next character. (vlax-put obj 'Textstring (strcat (chr 92) (chr 123) "ABCDEFG" (chr 92) (chr 125))) My version of initget. Multi radio buttons.lsp
    1 point
  8. Try something like this - change the value of the two variables at the top of the code to suit: (defun c:test ( / bln idx lst nla pat ) (setq pat "*block*" nla "NewLayer" pat (strcase pat) ) (if (setq sel (ssget '((0 . "INSERT")))) (repeat (setq idx (sslength sel)) (setq idx (1- idx) bln (cdr (assoc 2 (entget (ssname sel idx)))) ) (if (not (member bln lst)) (progn (setq lst (cons bln lst)) (processblock bln pat nla) ) ) ) ) (princ) ) (defun processblock ( bln str lay / ent ) (if (setq ent (tblobjname "block" bln)) (while (setq ent (entnext ent)) (processobject ent str lay) ) ) ) (defun processobject ( ent str lay / bln enx ) (cond ( (not (setq enx (entget ent)))) ( (/= "INSERT" (cdr (assoc 0 enx)))) ( (not (wcmatch (setq bln (strcase (cdr (assoc 2 enx)))) str)) (processblock bln str lay) ) ( (entmod (subst (cons 8 lay) (assoc 8 enx) enx)) (processblock bln str lay) ) ) ) (princ)
    1 point
  9. Hi, Written a tool for replacing (updating) blocks. Had some spare time untill my boss recently used the W-word again (work , yak!) Anywayz , its a prototype so I'm not sure its stable and safe yet because I only did some lab testing. I hope it will be usefull. Not sure if I will be able to work on it further any time soon because I still have a few ideas and wishes. gr. Rlx RlxBlk manual.doc RlxBlk.lsp RlxBlk.dcl
    1 point
×
×
  • Create New...