Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. maybe this helps : http://forums.augi.com/showthread.php?64428-LISP-Routine-to-remove-all-unrefernced-Xref-s
  3. Today
  4. Hi i need a script to detach all unreferenced xref at once. is that possible? Thanks S
  5. Hi, Would it be possible for someone to change the text on the below model. Need it to say Petersfield however once created its not possible to change and as i didn't manage to do this would be great if someone could help. Cheers in advance. COLUMN FITTING NAME CHANGE.dwg
  6. Alternative solution: (defun c:3dPoly_FixZ ( / doc elev enm fuzz i obj pt ss) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vla-endundomark doc) (vla-startundomark doc) (if (and (setq enm (car (entsel))) (setq obj (vlax-ename->vla-object enm)) (or (= "AcDb3dPolyline" (vla-get-objectname obj)) (prompt "\nError: not a 3D polyline ") ) ) (progn (setq i -1) (setq fuzz 0.001) (repeat (+ (fix (vlax-curve-getendparam obj)) (if (= :vlax-true (vla-get-closed obj)) 0 1)) (setq pt (vlax-safearray->list (vlax-variant-value (vla-get-coordinate obj (setq i (1+ i)))))) (if (and (setq ss (ssget "_X" (list '(410 . "Model") '(0 . "POINT") '(-4 . "<AND") '(-4 . ">,>,*") (cons 10 (mapcar '- pt (list fuzz fuzz 0.0))) '(-4 . "<,<,*") (cons 10 (mapcar '+ pt (list fuzz fuzz 0.0))) '(-4 . "AND>") ) ) ) (/= (caddr pt) (setq elev (caddr (vlax-get (vlax-ename->vla-object (ssname ss 0)) 'coordinates))) ) ) (vla-put-coordinate obj i (vlax-3d-point (list (car pt) (cadr pt) elev))) ) ) ) ) (vla-endundomark doc) (princ) )
  7. Add the red lines and the variable (top of code) Change your code to match the green line (substitute mf for 0.9)
  8. I stucked in modification of this lisp code. This lisp code multiplies the final summation of value to a fixed value of "0.9". But I need a change in this lisp code, that the code should take a user input value from command prompt. That means the the multiplication factor is a variable value. Pleas help. Advanced Thank you. (defun C:9FS (/ cpent elist en ip newtxt pt ss sum sumtxt txt) (princ "\n\t\t>>> Select text to get summ >>>") (if ;;select texts/mtexts on screen : (setq ss (ssget '((0 . "*TEXT")))) ;; if selected then : (progn ;; store the first text entity for using 'em further : (setq cpent (ssname ss 0)) ;; set initial sum to zero : (setq sum 0.) ;; loop trough selected texts/mtexts : (while ;; get the first text in selection : (setq en (ssname ss 0)) ;; get entity list of them : (setq elist (entget en)) ;; get the textstring by key 1 from entity list : (setq txt (cdr (assoc 1 elist))) ;; create output string : (setq sumtxt ;; concatenate strings : (strcat ;; convert digits to string : (rtos ;; add to summ the digital value of text : (setq sum (+ (* 0.9 (atof txt)) sum)) ;; 2 is for metric units (3 for engineering) : 2 ;; set precision by current : (getvar "dimdec"))) ) ;; delete entity from selection set : (ssdel en ss) ) ;; display message in the command line: (princ (strcat "\nSumm=" sumtxt)) (setq pt (getpoint "\nSpecify the new text location: ")) ;; get the insertion point of stored entity : (setq ip (cdr (assoc 10 (entget cpent)))) ;; copy text entity to the new destination point : (command "_copy" cpent "" "_non" ip "_non" pt) ;; get the last created entity : (setq newtxt (entlast)) ;; get entity list of them : (setq elist (entget newtxt)) ;; modify entity list with new text string : (entmod (subst (cons 1 sumtxt) (assoc 1 elist) elist)) ;; update changes : (entupd newtxt) ) ) (princ) ) (princ "\nStart command with STX...") (princ)
  9. BIGAL

    Lisp help!

    Look at this post Has the extract pline co-ords and has a re-create pline so replace the re-create with insert a block. Just use a repeat no need for the while.
  10. Hmm hold in excel pick a cell hold the Alt key down and type 0174 a ® should appear. Did you google excel and extended character set ? May give some clues of how to replicate keyboard typing with a text string. If you use mtext or text and do hold Alt down then type 0178 you will get squared 2. (setq obj (vlax-ename->vla-object (car (entsel "\nPick ")))) (setq ans (vla-get-textstring obj)) Try passing ans to a cell. I just copied from Autocad a ® to clipboard then pasted in excel and ® appeared.
  11. BIGAL

    Lisp routine fails to load

    My $0.05 we have all our lisps on a server and at home in a directory it was just a case of adding the paths and importantly adding trusted paths and it all works for 2016 2018 2019. We do have the file called Autoload.lsp not sure if that makes any difference. On a brand new box just run a lisp that sets all support paths and trusted paths so does in one go. Just find it easier to seperate our and my stuff from Autocad paths. I have not had to add any Command-s to any routines. I had a similar problem with a toolbar menu and reading end of line in the mnu file.
  12. My version of multi offset uses a csv approach so can have as many offsets as you like, -ve numbers will go in opposite direction. Its at home so can not post now will see if I can find here. it asks for user input so no hard coding offset -> 1,34,23.45,-12,-25 etc.
  13. Can you explain more if you have 100 objects you have 100 items of information. What do you plan to do with it ? The actual answer to your original question is the easy part.
  14. Yesterday
  15. rkmcswain

    proteinrun folder

    I'm afraid to add this to my %temp% folder clean up utility right now since I could run into huge deposits of this bloat, and it would stall the ACAD startup in the process.... I think I'll query the PCs first to get an idea of how widespread and thick this problem is.... Thanks for the info.
  16. Dani_Nadir

    Lisp modification

    Hello all, I have a routine that aligns blocks around a path, incrementing the attributes. But I have added some movement parameters to the block and the routine doesnt copy it the blocks. I am attaching the code and the block. Could anybody helps me? Thanks. ;; el primer bloque debe estar ya colocado en el punto medio del eje (defun c:pagbloc2 (/ _padzeros _insblock b dn se d n lnum inc bn xyz d1) (defun _padzeros ( s l) (if (< (strlen s) l) (_padzeros (strcat "0" s) l) s) ) (defun _insblock (e ds bnm data i il / pt p_ang) (setq pt (vlax-curve-getpointatdist e ds)) (setq p_ang (angle '(0.0 0.0 0.0) (vlax-curve-getfirstderiv se (vlax-curve-getparamatpoint e pt)))) (setq part (vlax-invoke (vlax-get (vla-get-ActiveLayout (vla-get-activedocument (vlax-get-acad-object))) 'Block) 'InsertBlock pt bnm (car data)(cadr data)(caddr data) p_ang)) (foreach att (vlax-invoke part 'getattributes) (vla-put-textstring att (_padzeros (itoa i) il))) ) (if (and (setq b (car (entsel "\nSelect block"))) (setq dn (getreal "\n Enter distance :")) (setq se (car (entsel "\nSelect path"))) ) (progn (setq d (vlax-curve-getdistatparam se (vlax-curve-getendparam se))) (setq n (fix (/ d dn))) (setq lnum (strlen (itoa n)) num 1) (setq inc dn) (setq bn (cdr (assoc 2 (setq bdata (entget b))))) (setq xyz (mapcar '(lambda (s) (cdr (assoc s bdata))) '( 41 42 43 8 10))) (setvar 'clayer (cadddr xyz)) (setq d1 (vlax-curve-getdistatpoint se (vlax-curve-getclosestpointto se (last xyz)))) (_insblock se (Setq inc (+ inc d1)) bn xyz (setq num (1+ num)) 2) (repeat (1- n) (_insblock se (Setq inc (+ inc dn)) bn xyz (setq num (1+ num)) 2) ) ) ) (princ) ) bloque paginar.dwg
  17. I'm creating a dynamic block of a fastener. This was easy when I was creating structural bolts because the threaded dimension is the same for each size. Now I'm creating a dynamic block of a flat head cap screw based on ASME 18.3 dimensions. In that spec the threaded dimension varies for different sizes. For this I created a Lookup that links to the Length, and thread length parameters parameters. This block works fine if I select a size from the lookup grip, but what I want to do is stretch the Length "L" parameter and have that also change the Thread Length (Grip Length) Is this possible? sample.dwg
  18. your welcome but 99.99% of the credits goes to Grrr! Think I would have used Grrr-read instead of initget (so I wouldn't have to use enter) but that would give longer code and be practical for no more than 9 or 10 commands. in the end , only thing that counts is you being happy. So well done Grrr !
  19. Hey Grrr Thank you so much This is awesome , it's working what i want Thank you so much rlx and Grrr
  20. Cad64

    Lisp routine fails to load

    That's a good idea. I'll try playing around with it later when I have some time. Thanks for the help.
  21. IT (helpdesk from my work) is currently driving me crazy haha. But so you have a couple of lisp files that are auto-loaded successfully. Remove your zoomlisp from any autoload and add just one of your little zoom defuns to one of those files and see what happens... if that works , add the next...
  22. Cad64

    Lisp routine fails to load

    I added the princ as the last line and removed the 2nd "" from ZR but it's still not loading from startup suite or acaddoc. This is driving me crazy!
  23. nice Grrr! maybe add a little user feedback .... );setq L (setq i 0) (princ (strcat "\n" (apply 'strcat (mapcar '(lambda (x)(strcat "(" (itoa (setq i (1+ i))) ") " x " ")) (cdr L)))) ) (setq n... ... of course only usefull when not having too many commands in the list
  24. Okay, heres one suggestion: (defun C:asd ( / L n itm ) (and (setq L '(nil ; Write down your commands here : "CIRCLE" "LINE" "PLINE" "TEST" ; <- example for a custom LISP command ); list ); setq L (setq n (progn (initget 6) (getint (strcat "\nSpecify number of the command (max " (itoa (1- (length L))) ") <exit>: ")))) (setq itm (nth n L)) (vla-SendCommand (vla-get-ActiveDocument (vlax-get-acad-object)) (strcat itm "\r")) ); and (princ) ); defun (vl-load-com) (princ) (defun C:test ( / ) ; <- example for a custom LISP command defining (alert "\nThis is my other routine, it does awesome stuff.") (princ) ); defun
  25. Tried it in 2017 and added (princ"\nzoomlisp loaded") as very last line and added file to startup suite and it works fine. You could try remove the second "" from c:ZR because that gave me Command: ZR Unknown command "ZR". Press F1 for help. indecating it has one enter to many. Since autocad xx whatever some commands are evaluated a little different and that's when they gave us command-s. To be able to test commands before they are executed. Other (probably stupid) way around might be something like (defun whatever () (defun c:ZW()....) (defun c:ZE()....) (defun.... etc) );end defun whatever ; last line in whatever.lsp so it executes automaticaly when loaded (whatever) Pitty I haven't got 2018 so I can't find out what is happening
  26. Cad64

    Lisp routine fails to load

    I don't really want to go that far, just because one lisp routine won't load. Maybe I'll try fooling around with it more later on but I need to get back to work now. Thanks for all the suggestions guys.
  27. Tharwat

    Lisp routine fails to load

    Yeah really strange. You may try to Repair the program from Control Panel -> uninstall -> Repair and this process would go back with your AutoCAD to the original installation which means you would need to readjust AutoCAD if you have your own customization like menu, toolbars ... etc other than the default one.
  1. Load more activity
  • Newsletter

    Want to keep up to date with all our latest news and information?

    Sign Up