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 513 results

  1. The task is simple. I have a drawing containing various blocks and a folder containing those blocks that separate in each dwg file . I want to make an auto routine: list all blocks contained in opening dwg > searching them in the library folder > redefine all blocks that containing in the list from the library folder. Please help me, because I couldnt find any existing lisps that be able to solve this problem
  2. Hello. I was wondering if this is even possible to do with LISP. So this is what I need - I need a Lisp that would create cross section for ditch. I would like to type in existing ground and ditch marks, then existing width of the ditch and existing bottom width of the ditch. After that I would like to create a designed ditch cross section, by entering the same parameters + slope must be 1 : 1.5. (Also, both, existing and designed ditch bottom centers must align.) For background I would need frame that You can see in added file. For me all this sounds unreal, but if there is someone that can produce something like this I would be really thankful. x section.dwg
  3. Hello everyone, The attached code that "Replace the text by block and transfer the value to the attribute" and the code is working. What I intend to do now and am not succeeding in doing is the following : 1) I noticed that, the block insertion point is being at the coordinate (Geometry --> Position X of variable T2B_Text). Is it possible to insert the block at the coordinate ( Text --> Text alignment X of variable T2B_Text)? (See image 1) 2) Is there any way to make sure that the total value of the variable "T2B_AttributeTag" is not all transferred to the block attribute? (See image 2) Example: T2B_AttributeTag = TO 1301-UZY-1826A Value of Block attribute (T2B_Block) = 1301-UZY-1826A (Accurate this way) Obs : The Txt file is by (DannyNL), taken from the AutoCad forum. Code Lisp.txt
  4. 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
  5. 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
  6. Hello, I'm searching to make a LISP, to change the layer of an attribute. Actually it in "TopoAlt" Layer, I like to change in "0" layer (or other) I thinked about DXF code but i don't find it with dumpallproperties. "Battman" command would be a good solution but I can't make script "-eattedit" command is pretty close but I'm stopped when It need " attribute selection". If i could scripting "-eattedit" with an automatic attribute selection (like an already made SSGET), I could change the layer, or other properties ! Any Idea ?
  7. 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.
  8. Hey guys, I have a HDD bore I'm working on getting a rough sketch into autocad. I have over 60+ rods on some of the drills. I am wondering if there is anything that asks for typical rod length and then I can import either a .txt or excel file to get rod angles from? The lisp I am looking for would, in this case, put polylines 15 feet long, back to back, at the respective pitches (-31%, -31%, -29%) which I converted into angles in degrees. Let me know how I can go about this or if anyone wants more information. Thank you.
  9. 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?
  10. 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.
  11. 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.
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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.
  18. 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?
  19. 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
  20. ;; [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 ")")) )
  21. 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!
  22. 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) )
  23. 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
  24. 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.
  25. 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
×
×
  • Create New...