Jump to content

Search the Community

Showing results for tags 'lisp'.

  • 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...

  1. Hello, I have a lot of drawings comming from an export f.e. Tekla stuctures. Those drawings have no layer structure, only thing to categorize entities are the colors. Is it possible to create layers per color and get the entities in that layer? Thanks in advance 1A - Fundering.dwg
  2. Dear User, I have 254 Alignment sheet file, i want to make List from Alignment sheet data as following 1) Chainage with Ground Level & Some Points Crossing or TP Please see Attachment ALG Profile Data.dwg REQUIRED LIST.xlsx
  3. I have contours of a site as well as an alignment with stationing. Along the alignment, points were taken and show how deep we need to go in respect to existing grade. What is the best way to show these points at the certain depth needed (X) taken at the station along the alignment (Y). I was going to create a separate feature line along top of the alignment to follow stationing and edit the depth/points in the panorama to then project the feature line to the profile. However, this seems tedious for the amount of profiles I have.
  4. plackowski

    Lisp Management

    This is sort of a broad topic, but how do you manage lisps for larger organizations, especially with the addition of working from home? We've got an outdated setup, with over 100 lisp routines in a series of drop-down menus, many of which are no longer in use. Some are loaded as part of our start-up processes, others are loaded from a network folder when they are chosen from the menus. Others are only used by one person, and no one else even knows they exist. Calling it a mess is an understatement. Some commands run particularly slow when used from work from home laptops, because the commands are loaded from the network each time. I'm envisioning a solution where we could copy our lisp folder and CUI files onto a remote user's computer, and only have to repath one or two items to allow them to access all the tools without an internet connection. Is this feasible? In the same vain, has anyone had any luck using the Autoload command to accomplish aspects of this?
  5. 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.
  6. Hi, I have a point on a 3D line's exact alignment , although the Z value of the point is 0. Can anyone help me with a lisp program to snap this point on the 3D line thus acquiring z value of the point. I have around 20000 points like this that need to be snapped and z value to be extracted. Thanks in advance.
  7. 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
  8. 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
  9. Hi, im looking for a lisp that finds any blocks that are in the same position based of insertion point and "combines these two blocks to create a new one with the names attached to them. for example say i has a line y co-ordinate starting at 0 ending at 5000. if two blocks where located at the midpoint 2500 (block a.dwg + block b.dwg) but these are 2 separate blocks. is there a way for these blocks to be combined into 1 new block called block a + block b.dwg? likewise if there where 3? block a + block b + block c.dwg?
  10. 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
  11. 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
  12. 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.
  13. 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?
  14. 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
  15. ;; [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 ")")) )
  16. 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!
  17. 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) )
  18. 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
  19. 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.
  20. 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
  21. 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.
  22. 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!
  23. 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!
  24. hanhphuc

    HP BUTTONS.lsp

    Version 1.0.1

    1,024 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
  25. 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)
×
×
  • Create New...