Jump to content

Leaderboard

  1. Lee Mac

    Lee Mac

    Trusted Members


    • Points

      21

    • Content Count

      20,061


  2. ronjonp

    ronjonp

    Trusted Members


    • Points

      10

    • Content Count

      1,270


  3. dlanorh

    dlanorh

    Community Members


    • Points

      10

    • Content Count

      423


  4. rlx

    rlx

    Trusted Members


    • Points

      9

    • Content Count

      1,419



Popular Content

Showing content with the highest reputation since 04/26/2019 in all areas

  1. 2 points
    FWIW, vl-filename-base should still perform as expected even if the filename in question contains periods, observe: _$ (vl-filename-base "179062-0000018159-Fa. Martin.dwg") "179062-0000018159-Fa. Martin" Hence the code could be written: (defun c:todo ( / d f ) (if (or (findfile (setq f (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) ".txt"))) (and (setq d (open f "w")) (not (close d))) ) (startapp "write" (strcat "\"" f "\"")) ) (princ) )
  2. 2 points
    (command "-dimstyle" "_R" "YOUR ANNOTATIVE DIMSTYLE NAME")
  3. 1 point
    I have no problem with them. They seem fine here. This is using Export This is DWG to PDF Export test dwg to pdf.pdf Export test dwg to pdf-Layout1.pdf
  4. 1 point
    It does work, but not as you intended. If you only want to pick a single item use either : (defun c:L0 () (command "_.chprop" (ssget ":S:E:L") "" "LA" "0" "C" "BYBLOCK" "") ) or (defun c:L0 () (command "_.chprop" (car (entsel)) "" "LA" "0" "C" "BYBLOCK" "") ) If you want to select multiple items then you'll probably need to split the (ssget) outside the command (easiest solution) as it requires an enter to end the selection process. Sometimes you can't cut corners (defun c:L0 ( / ss) (setq ss (ssget)) (command "_.chprop" ss "" "LA" "0" "C" "BYBLOCK" "") )
  5. 1 point
  6. 1 point
    Use NTH with your list of blocks. Something like this .. will work for multiple select too: (defun _getlistboxselection (lst sel) (mapcar '(lambda (x) (nth x lst)) (read (strcat "(" sel ")"))) ) (_getlistboxselection '("My" "Items" "In" "A" "List") "0 2 4")
  7. 1 point
    Sorry, I was running it on other file, I again tested it and works well, thanks a lot.
  8. 1 point
    Weird, I tried it on your dwg attachment, it works on my pc. Did you try it on that dwg? Maybe there's something different with the dwg you really want to use it on
  9. 1 point
    I always use the plot with DWG to PDF.
  10. 1 point
    Searching for this stuff online doesn't yield a lot of results, especially when it comes to AutoCAN'T. However, if you've wanted to have Dimetric and Trimetric projection views, here you go. This requires using DDVPOINT to set your angles and also saving it as a model view. The format below is [View Direction] - [From X Axis] - [From XY Plane] Dimetric Views NE - 45 - 15.5 NW - 135 - 15.5 SW - 225 - 15.5 SE - 315 - 15.5 Trimetric Views NE - 62.5 - 31.5 NW - 117.5 - 31.5 SW - 242.5 - 31.5 SE - 297.5 - 31.5 If anyone else has a different way of doing this, please share your methods.
  11. 1 point
    Yes I do this as I create the Layouts, so usually not really a problem for me. Try the LISP section, someone may have an automated solution.
  12. 1 point
    Then sit back and let your chairman face those challenges when it comes back up. Either way, if you're in the AEC industry, chances are you will have to adopt Revit at some point, period. Now it's his/her problem I guess. Keep trucking with Revit in the meantime. -TZ
  13. 1 point
    You might try command RTDISPLAY and set the value to 0. Hopefully it will work after that. I believe RTDISPLAY is set to 1 by default and, for whatever reason, can cause your rasters to bug out when panning or zooming. -ChriS
  14. 1 point
    Yeah when that company hired me on in 2008 I heard the site manager tell me that and that's when I realized I would kind of be on my own for drafting stuff. Also, asbuilts for military bases are even more important in many ways because the moment something breaks or goes wrong the asbuilts is the first place they look. Plus, on military bases you're commonly building around 60 year old utilities and the projects were regularly historic buildings. But I was usually able to get 90-100% accuracy on the asbuilts because for me it was a matter of pride. The base I worked on maintained a vault with permanent mylar prints and a few hundred sets were ones that I prepared personally. And it's kind of neat because I know they'll stay there. For one building they had a structure from 1940 and I went off the asbuilts to design a LEED renovation project in CAD. So I felt a kinship with that old drafter from 80 years ago. And then I wondered if my drawings would still be there in 80 years with some drafter in the future wondering who I was. -ChriS
  15. 1 point
    I see a few major problems with your profiles. 1. The starting points for each profile are not consistent. The yellow dot shows where each polyline starts. YOu want them all to start at the same relative position (e.g., bottom corner or center top, or...). 2. The polylines do not go in the same direction. G,H,and J are clockwise whereas K and L are counter clockwise. They should. 3. The polylines have way too many vertices. 478 for L, 544 for K, etc. ! I think creating half profiles and mirror after making a solid is a good strategy.
  16. 1 point
    dunno the working of the rest of the routine but with path's in general its either / or \\ but not // as far as I know (but then I don't know everything...)
  17. 1 point
    Hi, try this one (vl-load-com) (defun c:byBlock (/ col cnt lop sel) ;;;--------------------------------------------------------------------------------------------------------------------- ;;; subroutines ;; remove duplicated items in list (defun LM:unique (l) ; by Lee Mac (if l (cons (car l) (LM:Unique (vl-remove (car l) (cdr l)))))) ;; set "by block" to all entities in block definition (defun BB:setByBlock (nam / blc blk) (setq blc (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))) (setq blk (vla-item blc nam)) (vlax-for x blk (vla-put-layer x "0") (vla-put-color x acByBlock) (vla-put-linetype x "ByBlock") (vla-put-linetypescale x 1.0) (vla-put-lineweight x acLnWtByBlock) (vla-put-entityTransparency x "ByBlock:") (vla-put-material x "ByBlock") (if (eq (vla-get-objectName x) "AcDbBlockReference") (BB:setByBlock (vla-get-effectiveName x)))) ) ;;;--------------------------------------------------------------------------------------------------------------------- ;;; main (setq lop t) (while lop (princ "\nSelect blocks: ") (if (setq sel (ssget '((0 . "INSERT")))) (progn (setq cnt 0) (setq col nil) (repeat (sslength sel) (setq obx (vlax-ename->vla-object (ssname sel cnt))) (setq col (cons (vla-get-effectiveName obx) col)) (setq cnt (1+ cnt))) (setq col (LM:unique col)) (foreach x col (BB:setByBlock x)) (setq lop nil)) (princ "\nNo selection"))) (vla-regen (vla-get-ActiveDocument (vlax-get-acad-object)) acActiveViewport) (princ)) Dynamic blocks don't update and I dont know why. Vla-update doesnť work. Vla-resetBlock works but all dynamic parametres are lost.
  18. 1 point
    The process is not for the faint of heart. First, a person has to be comfortable with setting up and using 'beta' release software. This add-in specifically: . That Add-in can be seen in action here: https://knowledge.autodesk.com/support/autocad/learn-explore/caas/screencast/Main/Details/a3afe1be-968d-421c-81f6-167c375abfca.html https://knowledge.autodesk.com/support/autocad/learn-explore/caas/screencast/Main/Details/1d47a745-4bd2-4bef-9e5d-8cd087553ac6.html The latest version (still in testing phase) handles Solids and Surfaces, and I used that to get locations for the Isocurves. The beta in that link only handles solids so you would need to copy the surface, SurfScult it into a solid, evenly divide the resultant UVMap into 7 sections, that project back to the solid. Those positions align with those of the original surface.
  19. 1 point
    mine isn't (wasn't haha) so sophisticated as yours Grrr (defun t3 ( ) (setq lst (list (list "SETOUT_POINT_NO" "1") (list "SETOUT_POINT_NO" "2") (list "BLK01" "A" "B" "C") (list "BLK2" "D1" "C1" "B1" "A1") (list "BLK2" "D2" "C222" "B2" "A2") (list "BLK2" "e1" "e5" "f1111" "A1"))) (setq max-len (apply 'max (mapcar 'length lst))) (setq len-lst (mapcar '(lambda (x) (mapcar 'strlen x)) lst)) (setq new-lst (mapcar '(lambda (x) (repeat (- max-len (length x))(setq x (append x '(0)))) x) len-lst)) (mapcar ''((x)(apply 'max x)) (apply 'mapcar (cons 'list new-lst))) ) awel , got bigger apps to slay anyway , big server migration on the way , all drawings with Xrefs have to be modified. But this time , I make sure all paths are removed. Wasn't possible before because of outdated viewer on site but now I should be able to use projectname variable etc... thanx for the programming lesson Grrr Mac , nah , Mac Grrr sounds better...
  20. 1 point
    Thanks for reply wblock is one of those things that is a pain command to do easily. I tried this (setq ss (ssget "_X" '((0 . "POLYLINE") (-4 . "&=") (70 . 8)))) (setq x 0) (repeat (sslength ss) (command "_.-wblock" (strcat (getvar 'dwgprefix) (itoa x) ".dwg") "" (list 0 0) (ssname ss x) "" ) (setq x (+ x 1)) )
  21. 1 point
    Just a slight technical note. Osmode of 199 would give Endpoint, Midpoint, Centre, Insertion, Perpendicular. If you wanted Intersection instead of Insertion, Osmode would be 167.
  22. 1 point
    What I use: (defun c:bys nil (mapcar 'setvar '(CECOLOR CELTYPE CELWEIGHT) '("BYLAYER" "BYLAYER" -1)) (vl-cmdf "_.regen") (princ) ) (vl-load-com)
  23. 1 point
    Thank you for your sincere gratitude and compliments @Romero, I really appreciate your respect and appreciation for my time. I realise that offering suggestions for improvement for your existing code may have been more beneficial to your learning than rewriting the entire program, but nevertheless, I hope that you can benefit from studying my code, and of course, feel free to ask if you have any questions about the posted code.
  24. 1 point
    now you make me blush .. but the real champ is Lee Mac
  25. 1 point
    ronjonp, works perfectly. BIGAL, Emmanuel Delay and ronjonp ..... thanks for your time. Jaap
  26. 1 point
    As I said earlier in thread, there are alternative options; BricsCAD, IntelliCAD, NanoCAD, DraftSight (no longer free) and I recently tried one called ActCAD (built on intellicad) that wasn't bad. I mean $50/month for LT is not bad but after a few months you could have bought one of the CAD clones. Worth looking into /shrug
  27. 1 point
    (defun insert_block (nome) (if (not (tblsearch "BLOCK" nome)) (Steal "c:\\Blocks\\FTTx_Blocos.dwg" (list (list "BLOCKS" (list nome))))) (command "_.Insert" nome pause 1 1 "" "_.Explode" "_Last" "") )
  28. 1 point
    Can you post me a dwg I am working on something and need some real dwgs to test, It does block count but also takes into account thet attribute values. So count is a multi sorted depth count.
  29. 1 point
    VIEWSTD command will provide means for upping the view quality (Shaded view quality). I maxed it out to produce the attached. Formato_valvula_300DPI.pdf
  30. 1 point
    Here's another lightly tested with your sample drawing: (defun c:foo (/ a b d e s z nm) (cond ((and (setq a (car (entsel "\nPick block to copy: "))) (setq b (car (entsel "\nPick block to replace: "))) (= "INSERT" (cdr (assoc 0 (entget a))) (cdr (assoc 0 (entget b)))) (setq s (ssget "_X" (list '(0 . "insert") (assoc 2 (entget b))))) ) (setq nm (cdr (assoc 2 (entget a)))) (foreach c (mapcar 'vlax-ename->vla-object (mapcar 'cadr (ssnamex s))) (cond ((vlax-write-enabled-p c) (vla-getboundingbox c 'd 'z) (vla-put-name c nm) (vla-getboundingbox c 'e 'z) (or (equal (vlax-safearray->list d) (vlax-safearray->list e) 1e-4) (vla-put-rotation c (+ pi (vla-get-rotation c))) ) ) ) ) ) ) (princ) )
  31. 1 point
    (defun c:Text_Alignment (/ selobjs oldcmdecho) (setq oldcmdecho (getvar "cmdecho")) (setvar "cmdecho" 0) (setq selobjs (ssget '((0 . "TEXT")))) (process selobjs) (setvar "cmdecho" oldcmdecho) (princ) ) (defun process (selobjs / amode apnt apnt_x apnt_y count objname vlaxobj MinPoint MaxPoint minext maxext ext_l ext_r ext_m tpnt ) (initget "L M R") (setq amode (getkword "\nSelect alignment [Left Align (L) / Center (M) / Right Align (R)] <Center >:" ) ) (if (not amode) (setq amode "M") ) (initget 1) (setq apnt (getpoint "\nSelect the alignment point of the horizontal alignment direction:")) (setq apnt_x (car apnt) apnt_y (cadr apnt) ) (vl-load-com) (setq count 0) (repeat (sslength selobjs) (setq objname (ssname selobjs count)) (setq vlaxobj (vlax-ename->vla-object objname)) (setq MinPoint (vlax-make-variant)) (setq MaxPoint (vlax-make-variant)) (vla-GetBoundingBox vlaxobj 'MinPoint 'MaxPoint) (setq minext (vlax-safearray->list MinPoint)) (setq maxext (vlax-safearray->list MaxPoint)) (setq ext_l (car minext)) (setq ext_r (car maxext)) (setq ext_m (+ (/ (abs (- ext_l ext_r)) 2) ext_l)) (cond ((= amode "L") (setq tpnt (list ext_l apnt_y)) ) ((= amode "M") (setq tpnt (list ext_m apnt_y)) ) ((= amode "R") (setq tpnt (list ext_r apnt_y)) ) ) (if tpnt (command "_move" objname "" "non" tpnt "non" apnt) ) (setq count (1+ count)) ) ) This program only aligns text (no text spacing is considered).
  32. 1 point
    That was surprisingly doable. I started with function repath, a generic "change from -> to", but found it easiest to put most of the functionality in that function, since it already loops through all xrefs, so I renamed it repath2. Command RXRS (vl-load-com) (defun rename_file ( old-filename new-filename / ) ;; https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-AutoLISP/files/GUID-188B957C-4CDF-41C7-99BE-8080FA587F74-htm.html (if (findfile old-filename) (vl-file-rename old-filename new-filename) ) ) ;; https://www.cadtutor.net/forum/topic/39458-lisp-to-reload-xrefs-in-all-open-drawings/ (defun reloadall nil (vlax-for b (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (if (eq :vlax-true (vla-get-isxref b)) (vla-reload b)) ) (princ) ) ;; change the name and path properties of the xref ;; pattern: change all XREFS to (strcat main_dwg_name "_" xref_name) (defun repath2 ( / frm to path main_dwg objDefs) (setq main_dwg (vl-filename-base (getvar "dwgname"))) ;; main dwg name, not including path or extension (princ "\n") (princ main_dwg) (setq objDefs (vla-Get-Blocks (vla-Get-ActiveDocument (vlax-Get-Acad-Object)))) (vlax-for objDef objDefs (if (= (vla-Get-IsXref objDef) :vlax-True) (progn (setq path (strcat (vl-Filename-Directory (vla-Get-Path objDef)))) (setq frm (vla-Get-Name objDef) ) (setq to (strcat main_dwg "_" frm ) ) (rename_file (strcat path "\\" frm ".dwg") (strcat path "\\" to ".dwg") ) (princ (strcat "\nXREF file " frm " renamed to " to "\n" ) ) (vla-Put-Path objDef (strcat path "\\" to ".dwg")) (vla-Put-Name objDef to) (princ (strcat "\nXREF properties " frm " changed to " to "\n" ) ) ) ) ) ) ;; for Repath XRefS (defun c:rxrs ( / ) (repath2) ;; reload xrefs (reloadall) (princ) ) FYI, function repath + test function, not including all functions that you can find in the previous code block ;; change the name and path properties of the xref (defun repath ( frm to change_file / ) (setq objDefs (vla-Get-Blocks (vla-Get-ActiveDocument (vlax-Get-Acad-Object)))) (vlax-for objDef objDefs (if (= (vla-Get-IsXref objDef) :vlax-True) (progn (setq path (vl-Filename-Directory (vla-Get-Path objDef))) (if (= frm (vla-Get-Name objDef)) (progn (if change_file (progn (rename_file (strcat path "\\" frm ".dwg") (strcat path "\\" to ".dwg") ) (princ (strcat "\nXREF file " frm " renamed to " to "\n" ) ) )) (vla-Put-Path objDef (strcat path "\\" to ".dwg")) (vla-Put-Name objDef to) (princ (strcat "\nXREF properties " frm " changed to " to "\n" ) ) )) ) ) ) ) ;; test (defun c:rxr ( / frm to ) (setq frm "xref") (setq to "mainfilename_xref") ;; change the filename of the xref ;; change the (name and path) properties of the xref object (repath frm to T) ;; reload xrefs (reloadall) (princ) )
  33. 1 point
    Please recognize that your problem has been solved elsewhere so someone here does not waste their time.
  34. 1 point
    I opened your drawing and it looks fine here. The arcs look smooth and the endpoints are snapped together, so I'm not sure what's causing this on your end? One thing you could check would be your WHIPARC variable. Try changing the setting to "0" or "1" and then do a REGEN and see if that helps.
  35. 1 point
    Kate did you draw this or was it imported into AutoCAD? Honestly it looks like imported line work to me. The points not meeting at the top of the flower seem like the give away to me. Can you share the file for us to look st in detail?
  36. 1 point
    Like I said I zoom in and get it right then do zoom 0.9xp which shrinks it a bit, make them in model space. I did some pretty drastic deletes on some of my dwgs to get the slide right, removing things like dims to make the object clearer. For your image I would remove the hatching.
  37. 1 point
    Thank you very much @ronjonp . I really appreciate the hassle in helping me, now the code works perfectly, I have also edited it to not use as many if and use the cond function and the code is cleaner. I need to learn a lot more, but there I go little by little with some routines for my personal use. Error control is something I must learn soon. Your help came to me wonderfully. Thank you.
  38. 1 point
    Try this. Modified lisp slightly (defun rh:get_elev ( msg / ss rtn) (prompt msg) (setq ss (ssget "_+.:E:S" '((0 . "TEXT")))) (cond ( (not ss) (initget 3) (setq rtn (getreal "\nEnter Level : ")) ) (t (setq rtn (atof (cdr (assoc 1 (entget (ssname ss 0)))))) ) );end_cond );end_defun ;interpolation function to populate text elevation labels ; written by Nete Laana on 24.01.18 Modified dlanorh 30.04.19 (defun c:INTEL (/ p1 p2 p3 e1 e2 e3 d1 d2) ;define the function intel (while (setq p1 (getpoint "\nPick First Point : "));get the first point (setq e1 (rh:get_elev "\nSpecify First Elevation : ");get first elevation p2 (getpoint "\nPick Second Point : ");get the second point e2 (rh:get_elev "\nSpecify Second Elevation : ");get second elevation d1 (distance p1 p2); calculate total distance );end_setq (command "Line" p1 p2 "");draw the line (setq p3 (getpoint "\nPick Interpolation Point : "); pick desired interpolation point d2 (distance p1 p3); calculate distance a e3 (+ (/ (* (- e2 e1) d2) d1) e1);calculate interpolated elevation );end_setq (entdel (entlast)); delete the line (command "circle" p3 0.15); draw circle to identify point (command ".TEXT" p3 1.2 0 (rtos e3 2 2)); dump e3 as text object (setq p1 nil) );end_while (princ) );end_defun The lisp will now loop and ask for the next "Pick First Point : ". To exit the loop press return or click the right mouse button if it is set up that way.
  39. 1 point
    You can also do this, then you select the text objects instead of this: (setq layers (getstring "\nLayers to extract, example Layer1,Layer2 : ")) (setq ss (ssget "X" (list (cons 0 "TEXT") (cons 8 layers) ))) do this (setq ss (ssget (list (cons 0 "TEXT") )))
  40. 1 point
    Check out: http://www.lee-mac.com/clock.html
  41. 1 point
    (defun c:efernal (/ dcl_id dx dy erro f_imagem f_rbs hlp item lista0 lista1 lista2 lista3 lista4 lista5 lista6 lista7 reason topico dialog-fn dialog-fp dcl_id) ; (setvar "CMDECHO" 0) ; command echo could usefull when inserting block unless ins.point/scale/rot. are fixed ; to make perfect slide : ; ":image_button {key=\"img\";width=30;aspect_ratio=1.02;color=0;alignment=top;}}spacer;}" ; this means your slide is about 30x30 .... so insert symbol you want to take slide of in mspace, ; switch to paper space, make viewport size 30x30, make it active (double click), ; zoom to symbol , smile and take picture / slide (Create_Dialog) ; (SETQ dcl_id (LOAD_DIALOG "d:/Temp/Lisp/Cad-tutor/JuniorNogueira/C_Efernal.dcl")) (setq dcl_id (load_dialog dialog-fn)) (if (> dcl_id 0) (if (new_dialog "efernal" dcl_id) (progn (setq erro "Atenção:\n\nVocê não selecionou um item na lista..." hlp "Como usar:\n\nPrograme como usar seu help neste evento..." lista1 '("Lona 1" "Lona 2" "Lona 3" "Lona 4" "Lona 5") lista2 '("Ar condicianado 1" "Ar condicianado 2" "Ar condicianado 3" "Ar condicianado 4" "Ar condicianado 5" "Ar condicianado 6") lista3 '("Vestiário 1" "Vestiário 2" "Vestiário 3" "Vestiário 4" "Vestiário 5") lista4 '("Ref. 1" "Ref. 2" "Ref. 3" "Ref. 4" "Ref. 5") lista5 '("Móvel 1" "Móvel 2" "Móvel 3" "Móvel 4" "Móvel 5") lista6 '("Textos") lista7 '("Símbolo 01" "Símbolo 02" "Símbolo 03" "Símbolo 04" "Símbolo 05" "Símbolo 06" "Símbolo 07" "Símbolo 08" "Símbolo 09" "Símbolo 10") dx (dimx_tile "img") dy (dimy_tile "img") ) (defun f_rbs (k) (cond ((= k "rb1") (SETQ lista0 lista1 topico "LONARIA")) ((= k "rb2") (SETQ lista0 lista2 topico "CLIMATIZAÇÃO")) ((= k "rb3") (SETQ lista0 lista3 topico "VESTIÁRIO")) ((= k "rb4") (SETQ lista0 lista4 topico "REFEITÓRIO")) ((= k "rb5") (SETQ lista0 lista5 topico "MÓVEIS")) ((= k "rb6") (SETQ lista0 lista6 topico "TEXTOS")) ((= k "rb7") (SETQ lista0 lista7 topico "SÍMBOLOS")) ) (start_list "item" 3) (mapcar 'add_list lista0) (end_list) (start_image "img") (fill_image 0 0 dx dy 0) (end_image) (SET_TILE "msg" "Selecione um item na lista, por favor...") ) (defun f_imagem (/ slide) (if (setq slide (findfile (strcat "c:\\clientes\\sld\\" item ".sld"))) (progn (start_image "img") (fill_image 0 0 dx dy 0) (slide_image 0 0 dx dy slide) (end_image) ) (alert (strcat "atenção:\n\nf:\\clientes\\luciana\\sld\\" item ".sld\n" "não foi encontrado...")) ) ) (foreach x '("rb1" "rb2" "rb3" "rb4" "rb5" "rb6" "rb7") (ACTION_TILE x "(F_Rbs $key)")) (action_tile "item" "(setq item (nth (atoi $value) lista0))(f_imagem)") (action_tile "help" "(alert hlp)") (action_tile "cancel" "(done_dialog 0)") (action_tile "accept" "(if item (done_dialog 1)(alert erro))") (setq reason (start_dialog)) (unload_dialog dcl_id) (cond ((= reason 0) (princ "\n-> Cancelado...")) ((= reason 1) (alert (STRCAT "Executar o desejado aqui, com " topico " e " item)) (insert_block topico item) ) ) ) ) (alert "Atenção:\n\nNão foi possível carregar o arquivo dcl.") ) (if (and dialog-fn (setq dialog-fn (findfile dialog-fn)))(vl-file-delete dialog-fn)) (princ) ) (defun insert_block ( %topico %item / path blk) (setq path "f:/clientes/luciana/") (cond ((vl-catch-all-error-p (setq blk (vl-catch-all-apply 'strcat (list path %topico "/" %item ".dwg")))) (alert (strcat "*** Error: \n" (vl-catch-all-error-message blk)))) ((not (findfile blk)) (alert (strcat "Nada noppos blockos :\n" blk))) (t (command "-insert" blk)(while (= 1 (logand (getvar "cmdactive") 1))(command pause))) ) ) (defun Create_Dialog ( ) (if (and (setq dialog-fn (vl-filename-mktemp "tmp.dcl")) (setq dialog-fp (open dialog-fn "w"))) (mapcar '(lambda (x)(write-line x dialog-fp)) (list "efernal:dialog {label=\"E.Fernal\";initial_focus=\"msg\";:spacer {height=1;}" ":text{label=\"Selecione o tópico e depois o item\";key=\"msg\";alignment=centered;height=2;}" ":row {alignment=centered;fixed_width=true;spacer;" ":column {alignment=top;fixed_width=true;fixed_height=true;" ":text {label=\"Selecione tópico\";}" ":radio_column {alignment=top;fixed_height=true;" ":radio_button{label=\"Lonaria\";key=\"rb1\";}" ":radio_button{label=\"Climatização\";key=\"rb2\";}" ":radio_button{label=\"Vestiário\";key=\"rb3\";}" ":radio_button{label=\"Refeitório\";key=\"rb4\";}" ":radio_button{label=\"Móveis Gerais\";key=\"rb5\";}" ":radio_button{label=\"Textos\";key=\"rb6\";}" ":radio_button{label=\"Símbolos\";key=\"rb7\";}}}" "spacer;" ":column {alignment=top;children_fixed_width=true;children_fixed_height=true;" ":text {label=\"Selecione o item\";}:list_box {key=\"item\";width=40;height=16;alignment=top;}}" "spacer;" ":column {alignment=top;children_fixed_width=true;children_fixed_height=true;" ":text {label=\"Preview\";}" ":image_button {key=\"img\";width=30;aspect_ratio=1.02;color=0;alignment=top;}}spacer;}" "spacer;" ":column {:concatenation {alignment=centered;children_fixed_width=true;" ":button {label=\"Como usar\";key=\"help\";width=15;}" ":button {label=\"Cancelar\";key=\"cancel\";is_cancel=true;width=15;}" ":button {label=\"Inserir\";key=\"accept\";width=15;}}}}" ) ) ) (if dialog-fp (close dialog-fp)) )
  42. 1 point
    You are missing a closing bracket for the command expression - I would suggest: (defun c:xra ( / dwg ) (if (setq dwg (findfile "a3sheet.dwg")) (command "_.-xref" "_A" dwg "_S" 1 "_R" 0 "_non" '(0 0)) ) (princ) ) As for batch processing, you could look to run the above program across multiple drawing from an AutoCAD Script file (.scr). You may wish to refer to the following resources: An Introduction to Script Writing Script Writer Run AutoLISP Program on Batch of Drawings Batch Processing Explanation
  43. 1 point
    If your son is in school and has a school e-mail address he can use ANY AutoDesk product for free, to learn on. Just saying https://www.autodesk.com/education/home
  44. 1 point
    I was so impressed by this, I just had to post it! http://web2.airmail.net/terrycad/LISP/Troy.lsp
  45. 1 point
    Perfect for beginners download Free CAD blocks and start editing. http://www.cadpirate.com is a great site for free CAD blocks
  46. 1 point
    It is possible that some of you have noticed that the site AsmiTools no longer works due to unpaid hosting services. This is my conscious decision and not due to lack of funds. My present work has nothing to do with AutoCAD, and I find it difficult to maintain this site, as well as participate in this wonderful forum. I say goodbye to your friends. In this archive with all the AsmiTools, lisps each of you can use them as he wants. Perhaps they can be placed in AutoLISP Archive at this site. If someone wants to use my site, I will give it, write me at asmirnov#inbox.lv. Now I end my membership at the forum and erase my account. Goodbye friends, thanks for everything. AsmiTools_Lisps.zip
  47. 1 point
    You can check if a member if found in a list with member function . e.g. (setq a (list "1" "2" "3")) (member "2" a)
  48. 1 point
    There is the LAYOUTLIST function that return a list with the names of available layouts: (setq layoutOld (getvar "CTAB")) (foreach layoutCrt (layoutlist) (setvar "CTAB" layoutCrt) ;your action here ) (setvar "CTAB" layoutOld)
  49. 1 point
    I should probably add this too: http://www.theswamp.org/index.php?topic=24700.0
  50. 1 point
    Jeez, not very many links are there? . . . . . . . :lol: Just having some fun with you Lee. Looks like you've been very busy. I'm sure your efforts will be appreciated by many.
  • Newsletter

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

    Sign Up
×
×
  • Create New...