Jump to content

Leaderboard

  1. BIGAL

    BIGAL

    Trusted Members


    • Points

      23

    • Content Count

      14,576


  2. confutatis

    confutatis

    Members


    • Points

      15

    • Content Count

      54


  3. tombu

    tombu

    Trusted Members


    • Points

      10

    • Content Count

      1,411


  4. pBe

    pBe

    Trusted Members


    • Points

      10

    • Content Count

      3,135


Popular Content

Showing content with the highest reputation since 06/25/2021 in all areas

  1. Why not just load it with acad.lsp? As long as ACADLSPASDOC (System Variable) is set to it's initial value of 0 acad.lsp only loads when the first drawing is opened in a session. Don't use acaddoc.lsp to load it as it would load every time a drawing is opened which works well for most lisp routines.
    3 points
  2. Not BYLAYER (setq ss1 (ssget '((-4 . "!=")(62 . 256)))) Selection of color 7 to 11 (setq ss1 (ssget "X" '((-4 . ">=") (62 . 7) (-4 . "<=") (62 . 11))))
    3 points
  3. not my field of expertise but maybe Tharwat can help you with this : https://autolispprograms.wordpress.com/
    2 points
  4. (defun C:LENGHTPOL (/ ) (setq pol (ssget "_+.:E:S" '((0 . "LWPOLYLINE,POLYLINE")))) (if (not pol) (vl-exit-with-error "") ) (setq Ptx (getpoint "\nSelect text point: ") stringtx (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa (vla-get-ObjectID (vlax-ename->vla-object (ssname pol 0)))) ">%).Length \\f \"%lu2%pr2\">%" ) vltx (entmakex (list (cons 0 "TEXT") (cons 7 (getvar "TEXTSTYLE")) (cons 10 Ptx) (cons 1 stri
    2 points
  5. (defun C:CHEENT (/ gruent grublockstocke gruotherentity index ename height point ok pointtocke) (setq gruent (ssget) grublockstocke (ssadd) gruotherentity (ssadd) ) (repeat (setq index (sslength gruent)) (setq ename (ssname gruent (setq index (1- index)))) (cond ((and (= (cdr (assoc 0 (entget ename))) "INSERT")(= (strcase (cdr (assoc 2 (entget ename)))) "TOCKE")) (ssadd ename grublockstocke) ) (T (ssadd ename gruotherentity) ) ) ) (setq grublockstocke (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex grublockstocke)))
    2 points
  6. Many elite coders avoid Express Tools because some still have bugs (most easily fixed by replacing "command" calls with "command-s") in them but Help for them has been included in AutoCAD help in recent versions and I've used them since they started out as Bonus Tools. Many of them have been added as regular AutoCAD commands (most of the Layer commands for example), others have been dropped, while others around longer than Bonus Tools like Getsel.lsp and SSX.lsp are still considered Express Tools. Like Dadgad I use SYSVDLG (System Variable Editor…) and ALIASEDIT (Command Alias Editor…) on a r
    2 points
  7. If you don't want to use "vl-cmdf" try the following. (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex gru))) (entdel ent) ) or (repeat (setq i (sslength gru)) (entdel (ssname ss (setq i (1- i)))) )
    2 points
  8. That should work as it stands now. The error appears ONLY if there dimensions found, either on a locked layer [ not seen on screen probably off/frozen ] or the Dimension object(s) are on another layout other than the current tab not accessible by command call Try changing the ssget filter to something like this (setq A1 (ssget "_X" (list '(0 . "DIMENSION")(Cons 410 (getvar 'ctab)))))
    2 points
  9. (setq ss1 (ssget '((-4 . "<NOT") (62 . 256) (-4 . "NOT>"))))
    2 points
  10. Look at this example (startapp "C:/Program Files (x86)/Adobe/Acrobat Reader DC/Reader/AcroRd32.exe" filename) Or do you mean (command "-pdfattch" filename pagenumber pt 1 0)
    2 points
  11. In the CUI you can Customize Workspaces, expand Palettes and select Command Line then modify the properties below. Workspace Settings do get messed up sometimes like when a palette disappears. Having them automatically saved prevent you from being able to fix the issue by simply switching workspaces back and forth.
    2 points
  12. You're welcome To account for cases in which the target layer differs from the source linetype, consider the following: (defun c:fixlay ( / doc itm lay lst lyr ) (setq lst '( ;; Source Linetype Target Layer ("DASHED" "HIDDEN" ) ("CENTER" "CENTER" ) ("PHANTOM" "PHANTOM") ) ) (setq doc (vla-get-activedocument (vlax-get-acad-object)) lyr (vla-get-layers doc) ) (vlax-for blk (vla-get-blocks doc) (if (= :vlax-false (vla-get-isxref blk)) (vlax
    2 points
  13. I've seen this behavior when attributes share a name. Someone made a graphic scale and named all the attributes SCALE, even though the values need to be (scale), (scale x 2), (scale x 4), (scale x 1/2), etc. If you change any one of the values, they all change, so the scale is useless. The solution is to give them distinct names. I don't know if that applies to fields, but it's worth a look.
    1 point
  14. I have already noticed, everything is different when it comes to the fields, I will study this routine to learn more, I thank you very much for your attention and for sharing your knowledge.
    1 point
  15. I'm glad I could solve a problem for you! As for the extra data, I'll have to check it out. There will be new conditions that I didn't anticipate, maybe different strings. I'll take a look as soon as I have a moment.
    1 point
  16. You mention a Access database that is good as its like excel in that it has rows and columns. If you google Autocad MS-Access it should go to a Autodesk site with help about how to do. Go to the Jim Claypool post https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-gt-ms-access/td-p/787716
    1 point
  17. (defun C:MTEXTALI (/ *error* ss listsmallnumber a b data1 data2 data3 data4 data5 P1 P2 pol P1 oTX index loop selez codice data) (vla-startundomark (vla-get-activedocument (vlax-get-acad-object))) (defun *error* (msg) (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) (if (and msg (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*QUIT*,"))) (progn (princ (strcat "\nError: " msg)) (command-s "_UNDO" "") ) ) ) (setq ss (ssget '((0 . "TEXT")))) (if (and (/= (sslength ss) 3)(/= (sslength ss) 5)) (vl-exit-with-error (alert "Selection not 3 or 5 text!")) ) (setq
    1 point
  18. Not sure what your doing wrong this is what you are talking about, but Autocad or Bricscad. Only way for any one to check would be to post a dwg and a pdf.
    1 point
  19. SYSVDLG just opens the Pandora's Box of all Autocad commands, and explains all available options. It is a quick trip into the belly of the System Variables Beast. I favor cursor scrolling through any area that might seem to be of interest, because then the dialog box opens, providing a very quick, on the fly review of what the variable does. Spend some down time going through it, you'll learn plenty, and be glad you did.
    1 point
  20. It doesn't seem to me that the bpoly command wastes that much time....
    1 point
  21. Once you know the differences between the two functions QUOTE and LIST then you will know the answer by yourself.
    1 point
  22. Spoke to the guys at Civil Site Design should be able to do a lot of what you want. The software supports multiple subgrades. It also supports dual carriage way design etc. Does so much more. Price is on the website, you may want the yearly fee option. Again www.civilsitedesign.com
    1 point
  23. (defun c:dOff ( / *error* of undo doc ss ) (vl-load-com) (defun *error* ( msg ) (and undo (vla-EndUndomark doc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ) ) (if (and (setq gru (ssget '((0 . "ARC,CIRCLE,ELLIPSE,*LINE")))) (setq of (getdist "\nSpecify Offset Distance: "))) (progn (setq undo (not (vla-StartUndomark (setq doc (vla-get-ActiveDocument (vlax-get-acad-object) ) ) ) )
    1 point
  24. The question was asked here already : https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-copy-a-dictionary-from-one-entity-to-a-new-one/td-p/10465008 I think the goal OP wants to achieve is not to bind the same extension dictionary to 2 different entities, but to replace one that have this data (points) with another (block) that would be placed at the same location and inherit extension dictionary from sources... But Roy_043, I think you answered on OP's question in the title, thanks...
    1 point
  25. Hi everyone, I am out of the AutoCAD game now so I have no need for these books. The six books shown I am wanting to pass on to someone. I would prefer all go to one address and you will have to pay postage, which could be substantial. Send inquiries to richrdkent@gmail.com. Look closely at the email address, there is no A in there.
    1 point
  26. https://www.cad3d.it/forum1/threads/autosez-2-sezioni-e-profili-del-terreno-estrazione-automatica.17601/
    1 point
  27. Always happy to help, as you have me, getting used to ProSteel. I really like this feature, Ease Of Access settings in Windows 10
    1 point
  28. Hi, Give a try on this set method: (setq i 0) (while (and (setq s (getstring "\nString : ")) (/= s "") ) (set (read (strcat "Name" (itoa (setq i (1+ i))))) s) ) Test on commandline: String : S1 String : S2 String : S3 Results: _2_$ name1 "S1" _2_$ name2 "S2" _2_$ name3 "S3"
    1 point
  29. Sorry forgot about this will have another go at it. Have some time over the next few days.
    1 point
  30. I had a typo changed above.
    1 point
  31. Are you talking about setting the UCS to the face of your object? Your profile says you're using a pre 2000 version of Autocad, so maybe that's why the axis moves with the object? That doesn't happen in newer versions. I can set the UCS to the face of an object, but when I move the object, the axis stays where I set it. It doesn't move.
    1 point
  32. Post your changes then. Let's see what we can do differently to overcome your issue with the name. I would suggest using publish if you want multiple page pdfs
    1 point
  33. I've changed prompts to English, just for personal usage... Someone would wanted this version too... Bye... rs.lsp
    1 point
  34. You have posted that you have LT so it is possible to write scripts and run them in LT, you would use say Excel to create the script. You can edit a block using -attedit. I don't have LT so hopefully a script like this will work. This is for one attribute. In my title block the layout names are D01D02 D88 etc and the title block is always at 0,0. The X,Y value is a point on top of the attribute to be changed. Note the blank lines they are required. Steven-g is a power LT user so I am sure he can help for this type of task. catb layout1 -attedit Y DA1DRTXT PROJ_NO 794.0
    1 point
  35. From previous millenia : https://www.manusoft.com/software/freebies/draftools.html
    1 point
  36. Because we can (Defun _mismatchsocks (s1 s2 / s) (while (< (Setq p (Vl-string-mismatch s1 s2)) (strlen s1)) (setq s (cons (substr s1 (1+ p) 1) s)) (setq s2 (strcat (substr s1 1 (1+ p)) (substr s2 (1+ p)) ) ) ) (reverse s) ) _$ (_mismatchsocks "123410" "12310") ("4") _$ (_mismatchsocks "123410" "310" ) ("1" "2" "4") _$ (_mismatchsocks "123456789" "123589") ("4" "6" "7") (_mismatchsocks "CADTUTOR" "CDTTOR") ("A" "U") But then again, that's jsut one way of doing it. Just wait, others post with another way
    1 point
  37. I'm posting this for any future people encountering the same issue. Hopefully it will save them some frustration! I'm old and I like the Command Line under the tabs. Personal Pref... I tried letting it float and adjusting transparency settings for several months and I'm just an old dog. I just read every thread I could find about how to get the Command line to stay put. I tried every variation if LOCKUI with no luck. Saving Workspaces (and new Workspaces) didn't work for me. CUI didn't work either. (Restarting ACAD always reset the location) Easiest Fix - WSSETTINGS -&g
    1 point
  38. I just rotate the viewport. SEE THIS Maybe you are trying to recall MVSETUP? SEE THIS
    1 point
  39. For 1 (vlax-for block (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) maybe do wcmatch i ie blk1002 ie found a block with 1002 in name ) for 2 I had a go using Multi radio buttons there is a option for A-Z its in the code examples at start of code, uses a defun to make the A-Z list its pushing the limits, use "H" horizontal option, when ran a variable BUT is set this is last item picked so default button will change to match last picked. (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (if (not but)(setq but 16)) (setq ans2 (ah:butts but "h" (make
    1 point
  40. Seems a lot of effort to do (alert "hello world\n \nhey its 4:30 Beer o clock") or ; bit of fun (defun SpeakSapi ( s / sapi ) (if (eq (type s) 'STR) (progn (setq sapi (vlax-create-object "Sapi.SpVoice")) (vlax-put sapi 'SynchronousSpeakTimeout 1) (vlax-invoke-method sapi 'WaitUntilDone 0) (vlax-invoke sapi "Speak" s 0) (vlax-release-object sapi) ))) (speaksapi "Hello world") (speaksapi "Welcome from BIG al the humour you can expect at times") (speaksapi "PLEASE PAY YOUR MONEY") (speaksapi "I know you have wound the clock back" ) (speaksapi "Call me on 1234 5678 if you lik
    1 point
  41. Consider the vlax-Curve-GetStartPoint, and vlax-Curve-GetPointAtParam functions. Cheers
    1 point
  42. Here is a simple function implementing a ray-casting algorithm. However, note that this function does not test whether the ray 'grazes' a vertex - for example, in the following image the function will incorrectly determine the point as being outside the polyline since the ray intersects the boundary an even number of times.
    1 point
  43. Here is my method: [color=GREEN];; Point Inside-p - Lee Mac[/color] [color=GREEN];; Utilises a ray-casting algorithm to determine whether a[/color] [color=GREEN];; given point (WCS) resides within a supplied object.[/color] ([color=BLUE]defun[/color] LM:PointInside-p ( pt obj [color=BLUE]/[/color] lst ray ) ([color=BLUE]setq[/color] lst ([color=BLUE]vlax-invoke[/color] ([color=BLUE]setq[/color] ray ([color=BLUE]vla-addray[/color] ([color=BLUE]vla-objectidtoobject[/color] ([color=BLUE]vla-get-document[/color] obj) ([color=BLUE]vla-
    1 point
  44. Try this .... (defun c:Test (/ p1 p2 gr) ;;;;; Tharwat 28. June. 2012 ;;;;; (if (and (setq p1 (getpoint "\n Specify point :")) (setq p2 (getcorner p1 "\n Corner :")) ) (while (eq (car (setq gr (grread t 15 1))) 5) (redraw) (foreach n '((0.5 0.5 0.0) (-0.5 0.5 0.0)(-0.5 -0.5 0.0)(0.5 -0.5 0.0)) (grdraw (cadr gr) (mapcar '+ (mapcar (function (lambda (x) (* x (/ (getvar "VIEWSIZE") 25.)))) (trans n 1 0)) (cadr gr) ) 1 0 ) )
    1 point
  45. Command: (vl-catch-all-apply 'ptinsideent (list pt ent)) # - pt lies on ent -if you want to return T (pt lies on ent and may not be inside or outside ent) use : (vl-catch-all-error-p (vl-catch-all-apply 'ptinsideent (list pt ent))) Command: (vl-catch-all-apply 'ptinsideent (list pt ent)) T - pt is inside ent Command: (vl-catch-all-apply 'ptinsideent (list pt ent)) nil - pt is outside ent (if (vl-catch-all-error-p (vl-catch-all-apply 'ptinsideent (list pt ent))) (prompt "\nPoint is on entity") (if (ptisideent pt ent) (prompt "\nPoint is inside entity")
    1 point
  46. (defun GroupByNum ( lst n / r) (if lst (cons (reverse (repeat n (setq r (cons (car lst) r) lst (cdr lst)) r)) (GroupByNum lst n) ) ) ) (defun ptonline ( pt pt1 pt2 / vec12 vec1p d result ) (setq vec12 (mapcar '- pt2 pt1)) (setq vec12 (reverse (cdr (reverse vec12)))) (setq vec1p (mapcar '- pt pt1)) (setq vec1p (reverse (cdr (reverse vec1p)))) (setq vec2p (mapcar '- pt2 pt)) (setq vec2p (reverse (cdr (reverse vec2p)))) (setq d (distance '(0.0 0.0) vec12) d1 (distance '(0.0 0.0) vec1p) d2 (distance '(0.0 0.0) vec2p)) (if (equal d (+ d1 d2) 1e- (setq result T) (setq resu
    1 point
  47. Command: ColorX - change color all object of drawing. All layer unlock and thaw ColorXREF change color xref only on a current session. All layer unlock and thaw ColorXL - change color all object of drawing. Objects on the locked and frozen layers are ignored ColorXREFL change color xref only on a current session. Objects on the locked and frozen layers are ignored *** Add 20.03.2009 - Now ColorX ColorXREF work with Attrubutes *** Add 31.03.2009 - Now ColorX and ColorXREF colored dimension (include radius). *** Add 02.04.2009 - Change color Qleader, Mtext, Mleader. Add Simple progressb
    1 point
  • Newsletter

    Want to keep up to date with all our latest news and information?
    Sign Up
×
×
  • Create New...