Jump to content

Search the Community

Showing results for tags 'lisp'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 503 results

  1. I found valuable lisp for auto creation block. I want to improve this lisp to following requirement * block selected object individually, not in one block thanks AUTO-BLOCK.LSP
  2. Good Day, first of all I do not own these files, credits to them (forgot where did I get it) Anyway, I'd like to request a LISP that could compute the TOTAL VOLUME/MASS of SELECTED OBJECTS only, and displayed the result in table just like LAYLENGTH table format. For Example.. LAYER NAME | VOLUME Layer1 | 20 (in cubic meters) Layer2 | 35 (in cubic meters) Layer3 | 9.09 (in cubic meters) my drawing units are mostly in 9,091,687,322.3094 (millimeters) but I need it in 9.09 (cubic meters) if possible, and the table in LAYLENGTH is too small, can it also scale to the size of table in drawing file. Thanks 3DVOL2.lsp LAYLENGTH.txt Drawing1.dwg
  3. I want any explain how to use "Automatically Label Attributes" LiSP, i need steps how to add serial number on pipes this LISP from LEE MAC.
  4. How to select all polylines of certain layer(Eg: "Walls") and fillet them with (0.25) radius .I am just new at this lisp scene so any help would be appreciated.Below is the separate code that selects all elements of layer and another code fillets all selected polylines.How can i combine these two to create a single lisp for certain layer("walls") and (0.25) fillet. (defun c:SALL () (setq TargEnt (car (entsel "\nSelect object on layer to select: "))) (setq TargLayer (assoc 8 (entget TargEnt))) (sssetfirst nil (ssget "_X" (list TargLayer))) (princ) ) (defun C:FMP ; = Fillet Multiple Polylines (/ plss n) (if (setq plss (ssget "_:L" '((0 . "LWPOLYLINE")))) (repeat (setq n (sslength plss)) (command "_.fillet" "_polyline" (ssname plss (setq n (1- n)))) ); repeat ); if (princ) ); defun
  5. Can anyone help me for the create lisp for following condition . * I have 200 of text separately in my drawing ..i want block them individually each one. *i want select 200 of text at once block them individually .. Can any one create lisp for that.thank
  6. Hello, I have been trying for the last few days to automate out a process but have found myself pretty stuck. The process now involves manually going in and looking at the properties of the polyline and copying over the length to a separate excel file and matching it to the block that it goes to. The blocks all have their locations recorded on a separate excel file. The best lead that I have right now is that I can use Data Extraction to pull all of the poly line data at once. However sadly the Data Extraction command cannot pull information of the vertexes of polylines. This is where i need help! I was thinking that I could get around this by assigning the location of the first vertex of the polyline's (the start point 's) X and Y coordinates to the hyperlink, which CAN be extracted with Data Extraction. With the X and Y coordinates I would be able to cross compare the X and Y coordinates with the one from the block and know which it is matched too. I am very new to using LISP and have attempted to write it myself with little success. I am not sure how to write in the Hyperlink just as a string rather than as an actual address. I would like to be able to select all of the polylines at once and have to command change all the hyperlinks at once. Thanks in advance for the help, I am exited to get better at using LISP! Leo
  7. Hi everyone, Long-time user of the forum, but first-time poster. Thank you all over the years for your various contributions, they have helped me a lot over the last ~8years! My problem: I have ~15km of road where I need to calculate the width of the existing road every 10m, using a survey consisting of polylines. I then need to take this information and put it into a table (Excel for example). So far I've found a lisp routine that creates dimensions between two objects at a given interval, but I don't know how to get the information into Excel. Furthermore, it would be highly beneficial for me to identify the location of the measurements in Excel (whether identified by a simple sequential number or by x/y data). I look forward to this discussion! Thank you in advance, Vaughan.
  8. oturk1

    Lisp Needed

    HI, I need to create a Lisp to do the following in a series of drawings within a folder and then save as a new file. Superflatten entire drawing. Audit and fix errors. overkill entire drawing Convert all. Purge all. Remove Hatching. Remove DIms. Create boundary box from most southern and most western extremities of building. move boundary box and content from basepoint to be 2000,2000 from 0,0. Id like to type "deepclean" as command in future, I have over 1000 drawings to run this on so ideally id like to find a routine which will automatically do this to all files within a folder, without the need to manually open each one?
  9. Hello, i'm pretty new here and I don't have idea about making lisp. I would like to request an edit of this lisp file ( LAYLENGTH -Sum Line Length and arrange in table by layer.LSP) I do not own this, and I forgot where did I download it (credits to him/her). This is what exactly i'm looking, but I also want to get the TOTAL AREA / TOTAL VOLUME / TOTAL COUNT or QUANTITY by just selecting/dragging all the items at once, and the result will be displayed in TABLE related to LAYERS, just like this LAYLENGTH FILE. I don't mind if they are in separate lisp file. I hope you guys could help me. Thank you in advance. God Bless, Stay Safe
  10. ;; [INSERT INCEPTION SOUND EFFECTS HERE] ;; Preface: I've built a lisp routine that generates a script. The script then runs a SECOND lisp routine on a series of drawings. ;; I'm having serious trouble passing information from the first lisp routine to the second lisp routine. ;; The first lisp routine uses a DCL dialog box to gather user information, and the second lisp routine needs to apply this information to each drawing in a set. ;; I have assembled the information into a list of strings, which I'd like to pass as an argument into the second lisp (unless there's an easier way someone can share with me). ;; To do this, I've created the _StringifyList function, which creates a new list declaration string that gets written to the script file. ;; So here's the problem: ;; The strings in the arguments may contain quotes or backslashes since they are user entered. ;; The vl-string-translate commands I've added aren't properly appending extra backslash escape characters to make up for this. ;; Try running this example: (defun C:ListTest ( / *error* simpleList simpleListString) ;Return error descriptions to command line in the event of an error (defun *error* (/) (princ "\nInternal error") ) ;test strings are A,B,C ;to create a list: (setq simpleList (list "A" "B" "C")) (princ "simpleList: ") (princ simpleList) (princ "\n") ;result is not what we need: ;simpleList: (A B C) ;now lets wrap it with the stringify function: (setq simpleListString (_StringifyList simpleList)) (princ (strcat "simpleListString: " simpleListString "\n")) ;result is good, it can be written to a script as an argument now: ;simpleListString: (list "A" "B" "C") ;how about something more complicated though? ;test strings are one"quote, this\that, three"""quotes ;to create a list: (setq complexList (list "one\"quote" "this\\that" "three\"\"\"quotes")) (setq complexListString (_StringifyList complexList)) (princ (strcat "complexListString: " complexListString "\n")) ;result is bad. quotes have been replaced with backslashes, and backslashes haven't been duplicated. ;complexListString: (list "one\quote" "this\that" "three\\\quotes") ;what the result should look like (I think): ;complexListString: (list "one\"quote" "this\\that" "three\"\"\"quotes") (princ) ) ;; _StringifyList - plackowski ;; takes a list of strings and converts them to a declaration of a list of strings. ;; lst - [lst] A list of strings, like ("A" "B" "C") ;; str - [str] Output string in the format "(list "A" "B" "C")" (defun _StringifyList (lst / str) (setq str "(list") (foreach item lst ;any backslashes should be replaced with double slashes: \ -> \\ (setq item (vl-string-translate "\\" "\\\\" item)) ;any quotes in the string should be replaced with slash quotes to escape them: \" -> \\\" (setq item (vl-string-translate "\\\"" "\\\\\\\"" item)) (setq str (strcat str " \"" item "\"")) ) (setq str (strcat str ")")) )
  11. Hi, I am going through our company Lisp library to clean things up and rework old lisp's (as far as I can fix them with my basic knowledge of lisp's). For the following I have reworked the following HATCH Lisp How the routine looked before I got to rework on it: (defun c:HRST ( ) (command "layer" "t" "LAYERNAME" "on" "LAYERNAME" "m" "LAYERNAME" "c" "COLOR" "" "") (setvar "hpname" "ANSI37") (setvar "hpang" 0) (setvar "hpscale" (/ dsc 1.0)) (setvar "hpspace" (/ dsc 1.0)) (setvar "hpcolor" "bylayer") (command "hatch") );END DEFUN hrst BTW. none of this code got past the 1ste setvar (hpname),giving message: OsMode Rejected: status nill Reformed to something to do with our layer structure of our template, [after I worked on it a bit]: I stopped after number 2 because I noticed the transparency not resetting, other numbers will still be defined (defun c:HRST ( / ds lfac fac hsc http htrns hcs hspc ) (setq ds (getvar "dimscale")) (setq lfac (getvar "dimlfac")) (if (= lfac 0.1)(setq fac ds)) (if (= lfac 1)(setq fac (/ ds 1000.0))) (setq http (getstring T "\n Give type of hatch/solid: 1=restverontreiniging, 2=GA-VDVA-hatch, 3=GA-VDVA-solid, 4=GA-GW-hatch, 5=GA-GW-solid: ")) (if (= http "1") (progn (command "layer" "n" "restverontreiniging-D25S" "m" "restverontreiniging-D25S" "c" "214" "" "") (command "hpname" "ANSI37") (command "hpang" 0) (command "hpcolor" "bylayer") <--- this lead me to believe that transparancy could also be given this input "ByLayer" (setq htrns (getstring T "\n Give transparency (default ByLayer) [0-90]: ")) (command "cetransparency" htrns) <---- had to use cetransparency instead of hptransparency, because hptransparency would not set the transparency at all (setq hsc (* fac 1.0)) (command "hpscale" hsc) (setq hspc (* fac 1.0)) (command "hpspace" hpsc) (command "hatch" "" "" "") );end progn );end if (if (= http "2") (progn (command "layer" "t" "GR-GA-D15A" "o" "GR-GA-D15A" "m" "GR-GA-D15A" "c" "t" "210,174,163" "" "") (command "hpname" "ANSI32") (command "hpang" 0) (command "hpcolor" "bylayer") <--- this lead me to believe that transparancy could also be given this input "ByLayer" (setq htrns (getstring T "\n Give transparency (default ByLayer) [0-90]: ")) (command "cetransparency" htrns) <---- had to use cetransparency instead of hptransparency, because hptransparency would not set the transparency at all (setq hsc (* fac 1.0)) (command "hpscale" hsc) (setq hspc (* fac 1.0)) (command "hpspace" hpsc) (command "hatch" "" "" "") );end progn );end if );END DEFUN hrst But when testing I notice that my transparency for new hatches/lines/circles/.... is also set to 25 transparency after this routine. I tried fixing this with wirting a line before the );END DEFUN for resetting: - (command "cetransparency" "0") <---- not the best sollution as this does not set it back to "ByLayer" - (command "cetransparency" "bylayer") - (command "cetransparency" "byl") - (setvar "cetransparency" "0") <---- not the best sollution as this does not set it back to "ByLayer" - (setvar "cetransparency" "bylayer") - (setvar "cetransparency" "byl") I can go through the routine and it does everything I've set up to do so, except keeping the cetransparency the value given in the routine. Rather than resetting it to the default ByLayer But after looking through forums a lot of questions for BLOCKS hatch edits but not about single hatch transaprency variabels. Could someone help me out and also explain what I am doing wrong if possible for learning more about the process. Thanks in advance!
  12. Hello the Community, I am trying to combine two lisp into one , without sucess.. The first lisp is for deleting all atributes from selected blocks The second is to add liste of attributes to them ( little problem on this, I can't manage to define the attributes alignment to center ) I am trying to combine them into 1 lisp Could some one help me to fix it Thank You in advance for your help Cheers. Dany The 1st Lisp (defun tl_fld (v1 v2) (cdr (assoc v1 v2))) (defun c:attdel2 (/ ss cnt blk blkdat blknam blktblnam blknewdat blktbldat newblkdat atk_dbug nextent nextentdat nextenttyp endblklst ) (command "undo" "group") (setq atk_dbug nil) ;; (setq atk_dbug T) (if (setq ss (ssget (list (cons 0 "insert") (cons 66 1)))) (progn (setq cnt -1) (repeat (sslength ss) (setq blk (ssname ss (setq cnt (1+ cnt))) blkdat (entget blk) blknam (tl_fld 2 blkdat) newblknam (strcat blknam "_na") blknewdat (subst (cons 2 newblknam) (assoc 2 blkdat) blkdat ) blknewdat (subst (cons 66 0) (assoc 66 blknewdat) blknewdat ) ) (if (not (tblsearch "block" newblknam)) (progn (setq blktblnam (tblobjname "block" blknam) blktbldat (entget blktblnam) newblkdat (subst (cons 2 newblknam) (assoc 2 blktbldat) blktbldat ) newblkdat (subst (cons 70 (- (tl_fld 70 blktbldat) 2)) (assoc 70 blktbldat) newblkdat ) ) (if (entmake newblkdat) (progn (if atk_dbug (princ "\nStarting new block definition . . . ") ) (setq nextent (entnext blktblnam) nextentdat (entget nextent) nextenttyp (tl_fld 0 nextentdat) ) (while (and nextenttyp (/= nextenttyp "ENDBLK")) (if (/= nextenttyp "ATTDEF") (if (not (entmake nextentdat)) (princ "\nCan't make subentity.") (if atk_dbug (princ (strcat "\nAdding " nextenttyp " as subentity " (itoa xcnt) ) ) ) ) (if atk_dbug (princ "\nSkipping attribute definition.") ) ) (setq nextentdat nil nextenttyp nil ) (if (setq nextent (entnext nextent)) (setq nextentdat (entget nextent) nextenttyp (tl_fld 0 nextentdat) ) ) ) (setq endblklst (list (cons 0 "endblk") (cons 100 "AcDbBlockEnd") ) ) (if (not (entmake endblklst)) (princ "\nCan't terminate block definition") ) ) (princ "\nCan't start new block definition.") ) ) ) (if (tblsearch "block" newblknam) (progn (entdel blk) (entmake blknewdat) ) ) ) (setq ss nil) ) ) (command "undo" "end") (tl_$tlp) ) The second: Missing the alignmentCenter Attributes (defun c:addatribs ( / ss i blk blks def ) (and (setq ss (ssget '((0 . "INSERT")))) (setq i (sslength ss)) (while (> i 0) (setq blk (cdr (assoc 2 (entget (ssname ss (setq i (1- i))))))) (if (not (vl-position blk blks))(setq blks (cons blk blks))) ) ) (foreach blk blks (setq def (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) blk)) (vla-addattribute def ;------------ATTRIBUT 01 --------------------------------------------------- 3 acattributemodelockposition "DENOMBREMENT" (vlax-3D-point 0 +9) ;(vlax-put def 'Alignment 4) ;(vlax-put def acAlignmentmiddle) "DENOMBREMENT" "xxxx" ) ;------------ATTRIBUT 02 --------------------------------------------------- (vla-addattribute def 3 acattributemodelockposition "TYPE/CLASSE" (vlax-3D-point 0 +5) "TYPE/CLASSE" "xxxx" ) ;------------ATTRIBUT 03 --------------------------------------------------- (vla-addattribute def 3 acattributemodelockposition "CIRCUIT_ELEC/ADR_KNX/DALI_#2" (vlax-3D-point 0 -7) "CIRCUIT_ELEC/ADR_KNX/DALI_#2" "xxxx" ) ;------------ATTRIBUT 04 --------------------------------------------------- (vla-addattribute def 3 acattributemodelockposition "CIRCUIT_ELEC/ADR_KNX/DALI_#3" (vlax-3D-point 0 -11) "CIRCUIT_ELEC/ADR_KNX/DALI_#3" "xxxx" ) ;------------ATTRIBUT 05 --------------------------------------------------- (vla-addattribute def 3 acattributemodelockposition "CIRCUIT_ELEC/ADR_KNX/DALI_#4" (vlax-3D-point 0 -15) "CIRCUIT_ELEC/ADR_KNX/DALI_#4" "xxxx" ) ;------------ATTRIBUT 06 --------------------------------------------------- (vla-addattribute def 3 acattributemodelockposition "CIRCUIT_ELEC/ADR_KNX/DALI_#5" (vlax-3D-point 0 -19) "CIRCUIT_ELEC/ADR_KNX/DALI_#5" "xxxx" ) ;------------ATTRIBUT 07 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "DESIGNATION_ZONE" (vlax-3D-point 0 -23) "DESIGNATION_ZONE" "xxxx" ) ;------------ATTRIBUT 08 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "COSWIN" (vlax-3D-point 0 -27) "COSWIN" "xxxx" ) ;------------ATTRIBUT 09 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "NUM_LOCAL" (vlax-3D-point 0 -31) "NUM_LOCAL" "xxxx" ) ;------------ATTRIBUT 10 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "POSITION_BORDEREAU" (vlax-3D-point 0 -31) "POSITION_BORDEREAU" "xxxx" ) ;------------ATTRIBUT 11 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "DENOMINATION" (vlax-3D-point 0 -35) "DENOMINATION" "xxxx" ) ;------------ATTRIBUT 12 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "FOURNISSEUR" (vlax-3D-point 0 -39) "FOURNISSEUR" "xxxx" ) ;------------ATTRIBUT 13 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "MARQUE" (vlax-3D-point 0 -43) "MARQUE" "xxxx" ) ;------------ATTRIBUT 14 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "N°_DE_SERIE/REF" (vlax-3D-point 0 -47) "N°_DE_SERIE/REF" "xxxx" ) ;------------ATTRIBUT 15 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "ANNEE_DE_FABRICATION" (vlax-3D-point 0 -51) "ANNEE_DE_FABRICATION" "xxxx" ) ;------------ATTRIBUT 16 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "DEBUT_DE_GARANTIE" (vlax-3D-point 0 -51) "DEBUT_DE_GARANTIE" "xxxx" ) ;------------ATTRIBUT 17 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "DUREE_DE_GARANTIE" (vlax-3D-point 0 -55) "DUREE_DE_GARANTIE" "xxxx" ) ;------------ATTRIBUT 18 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "REF_FICHE_TECHNIQUE" (vlax-3D-point 0 -59) "REF_FICHE_TECHNIQUE" "xxxx" ) ;------------ATTRIBUT 19 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "ATTRIBUT_1" (vlax-3D-point 0 -63) "ATTRIBUT_1" "xxxx" ) ;------------ATTRIBUT 20 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "ATTRIBUT_2" (vlax-3D-point 0 -67) "ATTRIBUT_2" "xxxx" ) ;------------ATTRIBUT 21 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "ATTRIBUT_3" (vlax-3D-point 0 -71) "ATTRIBUT_3" "xxxx" ) ;(vlax-put 'Alignment acAlignmentmiddle) ;; 4 (command "_.attsync" "_N" blk) ) (princ) ) (vl-load-com) (princ) And there is a try to combien them: ( missing a line for attributes synchronisation) (defun tl_fld (v1 v2) (cdr (assoc v1 v2))) (defun c:kad (/ ss cnt blk blkdat blknam blktblnam blknewdat blktbldat newblkdat atk_dbug nextent nextentdat nextenttyp endblklst ) (command "undo" "group") (setq atk_dbug nil) ;; (setq atk_dbug T) (if (setq ss (ssget (list (cons 0 "insert") (cons 66 1)))) (progn (setq cnt -1) (repeat (sslength ss) (setq blk (ssname ss (setq cnt (1+ cnt))) blkdat (entget blk) blknam (tl_fld 2 blkdat) newblknam (strcat blknam "_na") blknewdat (subst (cons 2 newblknam) (assoc 2 blkdat) blkdat ) blknewdat (subst (cons 66 0) (assoc 66 blknewdat) blknewdat ) ) (if (not (tblsearch "block" newblknam)) (progn (setq blktblnam (tblobjname "block" blknam) blktbldat (entget blktblnam) newblkdat (subst (cons 2 newblknam) (assoc 2 blktbldat) blktbldat ) newblkdat (subst (cons 70 (- (tl_fld 70 blktbldat) 2)) (assoc 70 blktbldat) newblkdat ) ) (if (entmake newblkdat) (progn (if atk_dbug (princ "\nStarting new block definition . . . ") ) (setq nextent (entnext blktblnam) nextentdat (entget nextent) nextenttyp (tl_fld 0 nextentdat) ) (while (and nextenttyp (/= nextenttyp "ENDBLK")) (if (/= nextenttyp "ATTDEF") (if (not (entmake nextentdat)) (princ "\nCan't make subentity.") (if atk_dbug (princ (strcat "\nAdding " nextenttyp " as subentity " (itoa xcnt) ) ) ) ) (if atk_dbug (princ "\nSkipping attribute definition.") ) ) (setq nextentdat nil nextenttyp nil ) (if (setq nextent (entnext nextent)) (setq nextentdat (entget nextent) nextenttyp (tl_fld 0 nextentdat) ) ) ) (setq endblklst (list (cons 0 "endblk") (cons 100 "AcDbBlockEnd") ) ) (if (not (entmake endblklst)) (princ "\nCan't terminate block definition") ) ) (princ "\nCan't start new block definition.") ) ) ) (if (tblsearch "block" newblknam) (progn (entdel blk) (entmake blknewdat) ) ) ) (setq ss nil) ) ) (command "undo" "end") (tl_$tlp) ;(princ) ) ;---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- (defun c:addatribs ( / ss i blk blks def ) (and (setq ss (ssget '((0 . "INSERT")))) (setq i (sslength ss)) (while (> i 0) (setq blk (cdr (assoc 2 (entget (ssname ss (setq i (1- i))))))) (;if (not (vl-position blk blks))(setq blks (cons blk blks))) ) ) (foreach blk blks (setq def (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) blk)) (vla-addattribute def ;------------ATTRIBUT 01 --------------------------------------------------- 3 acattributemodelockposition "DENOMBREMENT" (vlax-3D-point 0 +9) ;(vlax-put def 'Alignment 4) ;(vlax-put def acAlignmentmiddle) "DENOMBREMENT" "xxxx" ) ;------------ATTRIBUT 02 --------------------------------------------------- (vla-addattribute def 3 acattributemodelockposition "TYPE/CLASSE" (vlax-3D-point 0 +5) "TYPE/CLASSE" "xxxx" ) ;------------ATTRIBUT 03 --------------------------------------------------- (vla-addattribute def 3 acattributemodelockposition "CIRCUIT_ELEC/ADR_KNX/DALI_#2" (vlax-3D-point 0 -7) "CIRCUIT_ELEC/ADR_KNX/DALI_#2" "xxxx" ) ;------------ATTRIBUT 04 --------------------------------------------------- (vla-addattribute def 3 acattributemodelockposition "CIRCUIT_ELEC/ADR_KNX/DALI_#3" (vlax-3D-point 0 -11) "CIRCUIT_ELEC/ADR_KNX/DALI_#3" "xxxx" ) ;------------ATTRIBUT 05 --------------------------------------------------- (vla-addattribute def 3 acattributemodelockposition "CIRCUIT_ELEC/ADR_KNX/DALI_#4" (vlax-3D-point 0 -15) "CIRCUIT_ELEC/ADR_KNX/DALI_#4" "xxxx" ) ;------------ATTRIBUT 06 --------------------------------------------------- (vla-addattribute def 3 acattributemodelockposition "CIRCUIT_ELEC/ADR_KNX/DALI_#5" (vlax-3D-point 0 -19) "CIRCUIT_ELEC/ADR_KNX/DALI_#5" "xxxx" ) ;------------ATTRIBUT 07 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "DESIGNATION_ZONE" (vlax-3D-point 0 -23) "DESIGNATION_ZONE" "xxxx" ) ;------------ATTRIBUT 08 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "COSWIN" (vlax-3D-point 0 -27) "COSWIN" "xxxx" ) ;------------ATTRIBUT 09 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "NUM_LOCAL" (vlax-3D-point 0 -31) "NUM_LOCAL" "xxxx" ) ;------------ATTRIBUT 10 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "POSITION_BORDEREAU" (vlax-3D-point 0 -31) "POSITION_BORDEREAU" "xxxx" ) ;------------ATTRIBUT 11 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "DENOMINATION" (vlax-3D-point 0 -35) "DENOMINATION" "xxxx" ) ;------------ATTRIBUT 12 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "FOURNISSEUR" (vlax-3D-point 0 -39) "FOURNISSEUR" "xxxx" ) ;------------ATTRIBUT 13 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "MARQUE" (vlax-3D-point 0 -43) "MARQUE" "xxxx" ) ;------------ATTRIBUT 14 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "N°_DE_SERIE/REF" (vlax-3D-point 0 -47) "N°_DE_SERIE/REF" "xxxx" ) ;------------ATTRIBUT 15 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "ANNEE_DE_FABRICATION" (vlax-3D-point 0 -51) "ANNEE_DE_FABRICATION" "xxxx" ) ;------------ATTRIBUT 16 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "DEBUT_DE_GARANTIE" (vlax-3D-point 0 -51) "DEBUT_DE_GARANTIE" "xxxx" ) ;------------ATTRIBUT 17 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "DUREE_DE_GARANTIE" (vlax-3D-point 0 -55) "DUREE_DE_GARANTIE" "xxxx" ) ;------------ATTRIBUT 18 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "REF_FICHE_TECHNIQUE" (vlax-3D-point 0 -59) "REF_FICHE_TECHNIQUE" "xxxx" ) ;------------ATTRIBUT 19 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "ATTRIBUT_1" (vlax-3D-point 0 -63) "ATTRIBUT_1" "xxxx" ) ;------------ATTRIBUT 20 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "ATTRIBUT_2" (vlax-3D-point 0 -67) "ATTRIBUT_2" "xxxx" ) ;------------ATTRIBUT 21 --------------------------------------------------- (vla-addattribute def 3 acattributemodeinvisible "ATTRIBUT_3" (vlax-3D-point 0 -71) "ATTRIBUT_3" "xxxx" ) ;(vlax-put 'Alignment acAlignmentmiddle) ;; 4 (command "_.attsync" "_N" blk) ) (princ) ) (vl-load-com) (princ) (DEFUN C:NEWCOMMAND; (C:kad) (C:addatribs) (princ) )
  13. Lippens Infra

    Slopes for 3D model

    Hello, I have a file attached. It's the design for a yard. I want to annotate the slope of the planes. I could draw a line and annotate the slope of that line as well. Is there a lisp program able to calculate the slope for planes/lines drawn in 3D? Thanks in advance. enveloppe ontwerp met afloop naar straat1.dwg
  14. I am trying to find a way of automating the renaming and publishing (PDF) 2 copies of same drawing with different names - 1 set that would go to a client that request a certain job no (which we have on the title block - as attribute=client_job_no) and the same set but titled with our own job number (also shown on title block as a attribute=our_job_no) for our own files I'm wondering where to start - we have a lisp routine that renames individual drawings tabs to one of the above attribute values but we have to run it on each drawing manually - then we publish those. and then do the same again with the other lisp on all the drawing individually and publish those. but would be looking to link something together that can automate more of the process - i suppose something along the lines run the Client_rename lisp on all open drawings - publish all to pdf in folder xzy:xzy/Client pdf and in same routine then run the OUR_rename lisp on all open drawings - publish all to pdf in folder xzy:xzy/our pdf. very rusty on lispsso any help /direction would be appreciated.
  15. hopefully you can read the red text on the picture as it explains what i'm looking for...if not, let me know and I'll type it out again. thank you
  16. Hey guys! How's going? Can anyone help me? Look: i need to place a lot of blocks in an extensive polyline but the blocks need to have a specific distance from the polyline beginning - and this distance will not be equal to each block. So, i thought in create a list (excel or csv file) and specify each block name and distance to the lisp read the archive and place the block at correct point. Did you get it? PS: remember that the blocks will not have the same interval distance. This is an example for the list layout. And the result is something like this: I hope you guys could understand and help me! - sorry for my english - Thanks! Much love from Brazil Wellington Moura
  17. Hi, I would appreciate if someone could help me with a lisp to explode all dimensions in multiple drawings in AutoCAD. I know exploding dimensions is not the best, however I have to do it for this specific project and I have a lot of drawings.
  18. aban

    Ortho with 45 degrees

    Hello, is there any way to get ortho to also include 45 degrees? I know polar tracking has the different angles, but I would need ortho to do that. If not, is there a way to make a lisp file to assign "DD" to turn that lisp file on? Please help with this because I really need this to work. Thank you!
  19. Hi, I'm having a hard time figuring out how to make a toolbar that can be downloaded for all to use. My problem is how do you share a "common directory" with the world? The toolbar works perfectly fine on my computer, because I have defined my own directory in the macro under the cui command. So the question is: how do you make a "common directory" so that the toolbar can be accessed on any computer? I hope I have made myself clear. Thanks!
  20. Not sure what i have been missing here. But finally decided to do something about our custom code. The lisp looks for a file and if present on system proceeds to step 2. Step 2 it checks for match with path. this is where i get confused.. I thought a (princ) close's the file clean (no loose ends) however the settings are there (in the options) but not applied. what am I missing? I have looked for some way to apply settings under the options dialog but no success. (Setvar "cmdecho" 0) (if (= "24.0s (LMS Tech)" (getvar "ACADVER")) (progn (if (not (wcmatch (getenv "PrinterConfigDir") "*path*")) ;Looking for Printer Configuration Search Path (setenv "PrinterConfigDir" "path") ;If not found add Printer Configuration Search Path ) (if (not (wcmatch (getenv "PrinterDescDir") "*path*")) (setenv "PrinterDescDir" "path") ;If not found add Printer Description Search Path ) (if (not (wcmatch (getenv "PrinterStyleSheetDir") "*path*")) ;Looking for Path in Plot Style Table Search Path (setenv "PrinterStyleSheetDir" "path;") ;If not found add Plot Style Table Search Path ) ) ) ;(alert "message") (Setvar "cmdecho" 1) (princ)
  21. hanhphuc

    HP BUTTONS.lsp

    Version 1.0.1

    75 downloads

    Thank you for supporting this "HP:BUTTONS.lsp" DCL library. This routine allows you to create DCL with multiple buttons associated to DCL action_tile list on the fly. It creates DCL box with single column x nRows of buttons, 'n' depends on the length of the 'action list' usage: (hp:buttons title lst width ht) title = Name caption on top of DCL - string lst = quoted list or progn list - list width = Width of the dialod box - integer ht = height of each button - integer returns nil or any execution (progn ... ) related to action_tile Save this file into your support folder, append to your startup autoload routine. In order to optimize the user experience, it allows maxinum 15 rows however you can abjust depends on screen size. HP:BUTTONS - v1.0 Free LISP by - hanhphuc email: hanhphuc.diy@outlook.com
  22. hanhphuc

    FIELD Bugs in windows x64

    hi guys i have a FIELD expression working fine in AC2007 old 32bit desktop LINE's delta properties= x,y multiply scale factor eg: 0.03,-0.04 x 1000, then entmake MTEXT should display dX=30 dY=-40 but it's weird, Bricscad/v19/win7 x64 (sorry as i'm newbie) dX %<cExpr (1000 * %<cObjProp Object(%<\_ObjId 1889532720>%).Delta after double click to edit it became dX %<\_FldIdx 0a (if ACAD double click to edit FIELD, a dialog pops up, you can check formula 1000 * 0.030 & preview) can you replicate this bug?? (defun foo (obj x) (apply 'strcat (mapcar '(lambda (a b) (strcat a "%<\\AcExpr (" (rtos (float x) 2 0) " * %<\\AcObjProp Object(%<\\_ObjId " (itoa (vla-get-objectid obj)) ">%).Delta \\f \"%lu2%pt" b "%pr8\">%" ") \\f \"%lu2%pt" b "%qf1%pr0\">%" " \n" ) ) '("dX " "dY ") '("1" "2") ) ) ) test delta x=0.03 y=-0.04 (and (setq pt (getpoint "\nSpecify point.. ")) (setq en (entmakex (cons '(0 . "LINE") (mapcar '(lambda (a b) (cons a (mapcar '+ pt b)) ) '(10 11) '((0. 0.) (0.03 -0.04)) ) ) ) ) (entmakex (list '(0 . "MTEXT") '(100 . "AcDbEntity") '(100 . "AcDbMText") (cons 40 (getvar 'textsize)) (cons 10 pt) (cons 1 (foo (vlax-ename->vla-object en) 1000.) )) ) ) need some comparison eg: xxxcad/20xx/winxx dX ? ? ? ? dY ? ? ? ? or something else? if there's bug, any solution? thanks
  23. Hello, I am searching for a lisp that can export the lengths of all selected polylines and export them to either Excel or an AutoCad table. I have found and tested around 20 lisps but so far cannot find the right one. There were only 2 that look promising, maybe they could be modified? One was by Lee Mac and the other Jimmy Bergmark. I can post the 2 Lisp if needed. The lisp would need to have you select multiple polylines and give the total lengths of each polyline in the order that they were selected in. Then the data would either appear on an AutoCad table or Excel. Thanks for any help that can be provided.
  24. Hello Everyone! I am using vanilla AutoCAD 2017. I have recently done a hydrographic survey, so I have a drawing full of depths (text). Wondering if anyone can point me to a lisp routine that can color code the text based on a range. For example any depths between 10 and 20 is green or any depths between 20 and 30 are red. Thanks in advance.
  25. Good day Everyone, I have an old topic here where I wanted to visualize my lisp routines into drop down menus. I have succeeded in developing an excel sheet to automate the process of adding and removing items into my menus without any hassle or any typing mistakes. However, I am stuck in a small portion of my lisp routines where I would like to call a specific command loaded from a .VLX file into my big .LSP routine. To be more clear, I have the following setup: Excel Sheet has all my data with all commands with their relative routines needed to exist in mylisp.lsp Same excel sheet has the hierarchy of the drop down menu. Each menu item is connected the commands above by calling the command with a simple macro. So far, all my lisp routines consists of native autocad commands which I do not face any issue with them so far. Last menu with last set of lisp routines should consist of simple and native commands combined with an external command loaded from .VLX file. every time I try to include this command loaded from the .VLX into another .LSP file, it can not be loaded and I can not pass any parameter to it as well. Let me show simple example: This is the routine which includes only native autocad commands: BlockName contains 7 different attributes (Some Text). (DEFUN C:EBMSS () (COMMAND "INSERT" "BlockName" "S" "1" "R" "0" (setq p (getpoint "\nSpecify insertion point: ")) "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" ) (COMMAND "LAYMCH" "L" "" "N""ITEM")) Same lisp routine with added the last command which is loaded from the VLX file. It does not work. (DEFUN C:K0 () (COMMAND "INSERT" "BlockName" "S" "1" "R" "0" (setq p (getpoint "\nSpecify insertion point: ")) "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" "Some Text") (COMMAND "LAYMCH" "L" "" "N""ITEM") (COMMAND "BLOCKC" "L" "R" "0" "PREFIX TEXT" "SUFFIX TEXT")) ;This command is executed from loaded .VLX file. FYI, I do not have access to the source code and I do not need to. All I need is to be able to initiate the command into the lisp routine to auto select the last added block with some attributes and passing some arguments to it. I wish if anyone can help me achieving this target. By the way, I am developing these programs to help me and my teammates speeding up the work progress at our design office. Thanks in advance and wish you all a wonderful day. Regards, Sameh Hosny
×
×
  • Create New...