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. Hi, I am Michel Can you kindly to help me to. I need a lisp for a cable routing. I have just a block consist of 3 attributes (TAG, SRTP, MVZ). I need to extract each relating value in separate column in excel. For example, if I select 5 blocks in drawing, I need to have 5 columns, each column has only 3 rows (3 attributes) and the possibility to have different rows for different electric cables in same file. Thank you in advance Michel richiesta.xlsx
  2. abcdef1234

    VP UNFREEZE

    ;VPFL - VP Freeze Layer ;(discussion forum routine, modified by XANADU) ; (defun c:VZ ( / ent cLayer pLayer) (setq ent (car(entsel "\nSelect object to VP-freeze layer: "))) (setq cLayer (getvar "clayer")) (setq pLayer (cdr (assoc 8 (entget ent)))) (if (= pLayer cLayer) (command "_.layer" "_s" "0" "_off" pLayer "") (command "_.vplayer" "_f" pLayer "_c" "") ) (prompt (strcat "Layer " pLayer " frozen in current viewport")) (princ) ) using vp freeze lisp i want to unfreeze lisp in viewport
  3. hello everybody , hope u all are great ... i have this lisp to get sum of some texts in autocad by choosing them one by one , but instead i wanna select those texts in one time by one selection click for them all ... i really appreciate ur help thanks in advance ;; wrriten by dlanorh from cadtutor (defun rh:em_txt ( pt txt lyr sty tht xsf) (entmakex (list '(0 . "TEXT") '(100 . "AcDbEntity") '(100 . "AcDbText") (cons 10 pt) (cons 1 txt) (if lyr (cons 8 lyr)) (if sty (cons 7 sty)) (if tht (cons 40 tht)) (if xsf (cons 41 xsf)) );end_list );end_entmakex );end_defun (vl-load-com) (defun c:t+ ( / *error* sv_lst sv_vals ent elst el num xsf ans tot qflg nlst sel pt txt) (defun *error* ( msg ) (mapcar 'setvar sv_lst sv_vals) (if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nAn Error : " msg " occurred."))) (princ) );end_defun (setq sv_lst (list 'cmdecho 'osmode 'dynmode 'dynprompt) sv_vals (mapcar 'getvar sv_lst) );end_setq (mapcar 'setvar sv_lst '(0 0 3 1)) (while (not tot) (setq el (entget (setq ent (car (entsel "\Select First Text Number Entity : "))))) (cond ( (wcmatch (cdr (assoc 0 el)) "*TEXT") (cond ( (= (cdr (assoc 0 el)) "TEXT") (setq num (atof (getpropertyvalue ent "TextString")) xsf (cdr (assoc 41 el)))) (t (setq num (atof (getpropertyvalue ent "Text")) xsf 1.0)) );end_cond (cond ( (zerop num) (setq num nil) (alert "Text Entity NOT a number")) (t (setq tot num))) ) (t (alert "Not a Text Entity")) );end_cond (cond (num (setq nlst (cons ent nlst)))) );end_while (while (not qflg) (setq sel (entsel "\nSelect Next Text Number Entity : ")) (cond ( (not sel) (initget "Yes No") (setq ans (cond ( (getkword "\nSelection Finished [Yes/No] <No>")) ("No"))) (if (= ans "Yes") (setq qflg T)) ) );end_cond (cond ( (and (not qflg) sel) (setq elst (entget (setq ent (car sel)))) (cond ( (and (wcmatch (cdr (assoc 0 elst)) "*TEXT") (not (vl-position ent nlst))) (cond ( (= (cdr (assoc 0 elst)) "TEXT") (setq num (atof (getpropertyvalue ent "TextString")))) (t (setq num (atof (getpropertyvalue ent "Text")))) );end_cond (cond ( (zerop num) (setq num nil) (alert "Text Entity NOT a number"))) ) ( (vl-position ent nlst) (alert "Already Selected") (setq num nil)) (t (alert "Not a Text Entity")) );end_cond (if num (setq tot (+ tot num) nlst (cons ent nlst) num nil)) ) );end_cond );end_while (cond ( (and tot qflg) (setq pt (getpoint "\nSelect Total Insertion Point : ") txt (if (zerop (rem tot 1.0)) (rtos tot 2 0) (rtos tot 2 3)) );end_setq (rh:em_txt pt txt (cdr (assoc 8 el)) (cdr (assoc 7 el)) (cdr (assoc 40 el)) xsf) (if nlst (foreach o (mapcar 'vlax-ename->vla-object nlst) (vla-delete o))) ) );end_cond (mapcar 'setvar sv_lst sv_vals) (princ) );end_defun
  4. Hey guys, this is my first post on this forum so thanks in advance for any help. Currently I am using Lee Macs "Field to attribute" lisp command to get the length of a line (a steel beam in this case) and insert the field into a block to get an item count. Currently I've modified the LISP command to format the length from feet-inches into a single number to represent a 1' spacing of our product. What I want to do is either take that field value (the length of the beam) and and 1'-0" to it, or take the formatted value and add 1 to it. The reason is when we draw our beams we like to shorten the lines by 6" on each side so we know what beams are separate members and which are continuous. This causes the field value to be 1'-0" less than it should be. Any help on this would be appreciated.
  5. I was trying to change the shade plot of a view port by lisp but I didn't see any way to do that through the change properties or through the dxf codes. (progn (setq ss1 (ssget "x" '((0 . "VIEWPORT")))) (command "change" ss1 "" "p") )
  6. Hello, I have some drawings containing 2D lines in multiple layers (by pipe diameter). Now I manually check each intersection or vertex and mark the right fittings needed. Is it possible to create a simple object (a circle or something) at each vertex/intersection in a layer named as for example "dia 315 Y" "dia 160 elbow".... it's only for informational purpose, the looks don't matter. I need to order the right pieces and that takes a hell of a lot of time.... example.dwg
  7. Hi Everyone, From few days I'm trying to make an auto lisp which can understand the difference between 2 different layers and calculate area according to that. Unfortunately I'm not getting proper results anyone can please help. I was trying to create the lisp in below steps. Step-1: After entering command user will select whole drawing in single selection Step-2: Lisp will select only object in Layer-1 & Layer-2 (Other layers objects will be ignored) Step-3: Lisp will calculated the area of Layer-1 & Layer-2 Step-4: Now it will Subtract the area of Layer-2 from Layer-1 Step-5: and paste it as Text.
  8. I would like to merge the lisps I show at the end into one, where the process is first ADDID.lsp and then OD2ATT.lsp If it were possible with your help to add a new functionality to addid.lsp and that is that when you copy the block name in the TIPO_SENAL field of the Object Data You can check the block name to be able to change it to another, with some examples it would be enough to add as many times as this operation is necessary. thank you very much, greetings .... (defun c:ADDID (/ n inc enam idd efn) (setq tn "SDM_SEN_SENALIZACION") (prompt "Seleccionar señales") (princ) (setq n (getint "\n Ingrese valor de Inicio: ") ss (ssget '((0 . "insert"))) ) (setq inc 0) (repeat (setq len (sslength ss)) (setq enam (ssname ss inc)) (setq idd (itoa n)) (setq efn(vla-get-effectivename(vlax-ename->vla-object enam))) (ade_odaddrecord enam tn) (ade_odsetfield enam tn "INTERNO_SENAL" 0 n) (ade_odsetfield enam tn "TIPO_SENAL" 0 efn) (command "chprop" enam "" "c" "ByLAyer" "") (setq inc (1+ inc) n (1+ n) ) ) (alert "The entities selected with INTERNO_SENAL were updated") (princ) ) .... (defun c:OD2ATT (/ ss) (vl-load-com) (if (setq ss (ssget '((0 . "INSERT") (2 . "`*U*")))) ((lambda (i / e s od r v n d tag) (while (setq e (ssname ss (setq i (1+ i)))) ;; Extract object data (setq b (ade_odgetfield e (setq od (car (ade_odgettables e))) "INTERNO_SENAL" 0)) ;; Populate attributes (if (and (setq n (vla-get-effectivename (setq v (vlax-ename->vla-object e)))) (setq d (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) n))) (foreach attrib (vlax-invoke v 'getattributes) (vlax-for item d (if (= (vla-get-objectname item) "AcDbAttributeDefinition") (if (= (vla-get-tagstring attrib) (vla-get-tagstring item)) (cond ((= "INTERNO" (setq tag (vla-get-tagstring item))) (vla-put-textstring attrib b)))))))) )) -1)) (princ)) ADDID.lsp OD2ATT.lsp eg.dwg
  9. Hi! With the help of the autodesk forum I have this lisp that consecutively increments a numeric value in a specific field of OD, also copies the block name to another field of the same OD. This lisp assigns the internal consecutively when the field INTERNO_SENAL has a data type of character, can the same process be done when the type of the OD field is as internal? Having this lisp is it possible that the value of INTERNO_SENAL is also copied in the INTERNO attribute of the block? ADD_ID.lsp
  10. 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
  11. 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.
  12. Hello, everyone. I get 50 DWG Drawings per day and i had to convert it to dxf. So i made a little lisp to automate the conversion process. LISP: (defun c:s() (command "dxfout") (command "") (command "16") (command "regen") (command "_close" "y") ) Now that i have this lisp i'll drag all the 50 dwg's to autocad for opening them and then i'll have to press "s" 50 times. Now pressing "s" 50 times is the irritating part. Can somebody help me to mass save the document without having to open the document and pressing "s" 50 times!!!
  13. Hi. I am a newbie with Lisps. But was just wondering if there is an existing lisp out there to explode all blocks (both model space and paper space) except for blocks in this layer "A3_TT"? I am trying to look for a routine cause I need to apply it to almost thousands of drawings. Any help would be much appreciated. Best regards, William
  14. Hello everyone, I hope you all healty and feeling hapy. Many greeting to you from capital of the Turkey I've a problem about syntax of my lisp that can print perimeter and area to attribute (Especially Room Tag). I tried many times to fix this error but I never find a solution about my problem. Thank you That's my lisp; ;;;;;; ;;;;;;; (defun AREA_PERIMETER_SEC () (prompt "\nSelect a closed POLYLINE") (setq sonobje (car (entsel))) (if sonobje (progn (setq silobje sonobje) (redraw silobje 3) (command "area" "e" sonobje) ;(alert "Bulunan alan.") (setq alan (/ (getvar "area") 10000)) (setq cevre (/ (getvar "perimeter") 100)) (print)- (prompt (strcat "Bulunan alan ve cevre: " (rtos alan 2 2) "m² " (rtos cevre 2 2) "mt. " ) ) ) ;progn (progn (alert "Kapali alan bulunamadi.Tekrar deneyin.") (exit) ) ) ;if ) ;;;;-----MAIN PROGRAM----- (defun DEGIS (ss es-alan es-cevre / ye-alan ye-cevre) (setq ye-alan (cons 1 (rtos alan 2 2))) (setq ye-cevre (cons 1 (rtos cevre 2 2))) (entmod (subst ye-alan es-alan (entget (entnext (entnext (entnext ss))) ) ) ) (entmod (subst ye-cevre es-cevre (entget (entnext (entnext (entnext (entnext ss))) ) ) ) ) (entupd ss) (print) (prompt (strcat "Onceki alan ve cevre: " (cdr es-alan) "m² " "mt. " ) ) (print) (prompt (strcat "Yazilan alan ve cevre: " (cdr ye-alan) "m² " (cdr ye-cevre) "mt. " ) ) (princ) ) (defun C:RAPT () ; (/ obje x) (setq objeler nil silobje nil ) ;;(prompt "\nHesaplanacak alani,") (initget "Orta Ciz Sec") (setq sec (AREA_PERIMETER_SEC)) (setq ss (car (entsel "\nChoose the ROOM NUMBER to be CHANGED") ) ) (setq x 0) (if ss (progn (setq obje (substr (strcase (cdr (assoc 2 (entget ss)))) 1 7)) (setq es-alan (assoc 1 (entget (entnext (entnext (entnext ss))) ) ) ) (setq es-cevre (assoc 1 (entget (entnext (entnext (entnext (entnext ss)) ) ) ) ) ) (if (= obje "MTAG") (DEGIS ss es-alan es-cevre) ) ;if ) ;progn ) ;if (command "") ) (princ)() RAPT.lsp
  15. Dear team, I need a lisp program or tips tricks to draw a close polyline within PRoW for land acquisition plan and area for Road project. I want all at one click command. Currently I am using boundary command but is one by one clicking. Hatch for reference, need a close polyline. See attached image And cad file. LAP-CLOSE PL.dwg
  16. There are multiple attributes that I want to be able to increment by 1. However there are a couple of problems, there are different attributes but I want to be able to select all of them and I the value that I want to increment by 1 has a letter before it.
  17. Hello. In my drawing, there are many blocks around and it says how many floors they are inside. I want to extrude these blocks. But since they are so numerous, it takes a long time to do it one by one. I'm looking for a lisp to extrude these blocks according to the numbers written in them. It also works to select polylines based on the numbers inside I'm sorry for my bad english. http://prntscr.com/yz55au
  18. Hi all, I have written a lisp that uses the vl-file-copy command to move this PDF to another folder. But this only works for the original pdf, not for the link! Does anyone know if I need to change something in the command to be able to move the link? The file name remains the same: "sheet_cover_building1".
  19. Hello, I am attempting to put together a LISP that creates a table of cumulative geometric properties of selected objects. I would like to be able to quantify Erosion and Sedimentation Control BMPs by layer for a cost estimation. Controls such as compost filter sock and orange construction fence are polylines, erosion control blanket is hatched, and inlet protection is a block. The controls are all on their own respective layers. The idea is that I would be able to select one occurrence of each of these controls (polyline, hatch, block), have the LISP apply the "select similar" command, and create a table that reports back the length of the polylines by layer, the cumulative area of the hatches by layer, and a count of the blocks by layer. Due to my inexperience with LISP, I am afraid that I am unable to create this app in time for when I need it. It would be greatly appreciated if someone could help out in creating this app. Thank you for your time.
  20. I got the Lisp from this Topic https://www.cadtutor.net/forum/topic/44246-measure-distance-between-polylines/page/2/ by Lee Mac but I want to use Lisp for tunnel work. The text must seperate by setting tolerance (Can set the tolerance for Overbreak and Underbreak) In tolerance (Green Text) ,Overbreak (Blue text) and Underbreak (Red text) Ps.1 Thank you for your help Ps.2 My English skill is bad
  21. Hi, I need a small lisp that opens and closes a file for me in the background. Nothing needs to be done. In this lisp the file is opened but not closed. (defun c:open_close_explorer () (setq Path "Y:\\Folder\\Data\\Test.txt") (setq File (StartAPP "Explorer.Exe" Path)) (close File) (princ) ) Does anyone have an idea?
  22. Hi, I'm trying to query the variable "Weight" and if it has the content "50" I want to define a new variable: "Stamp" with the content "internal". Is WCMATCH the right command for this? (if (= wcmatch Weight "50") (progn (setq stamp "intern"))) (princ)
  23. Hi, I'm working on a LISP that in part needs to grab the filename (without extension) for a command - I managed to do this using 'vl-filename-base' but since it needs to run in acoreconsole it can't use anything from the VL Library. Is there any way to either remove ".dwg" or remove the last 4 characters from a string in only vanilla LISP? Here's what I've got so far (defun C:PlotToLocation (/ filename) (vl-load-com) (setvar "cmdecho" 0) (setq filename (vl-filename-base (getvar 'dwgname))) (setq filename (strcat "A:\\X\\Y\\" (vl-filename-base (getvar 'dwgname))".pdf")) This sets the filename to "A:\X\Y\filename.pdf" I can currently get "A:\X\Y\filename.dwg.pdf" but since the PDFs have to follow a naming standard, I need a way to remove the ".dwg".
  24. Hello Community! I have been researching this for some time, I am trying to know if it is possible through a routine (lisp) to transfer / copy the information from LT (link template associated with a database in access) to the OD (object data) as I show in the image. So i need a very specific Lisp/VLisp/VBA/Dotnet routine who asks for : -- The Link Template DB name -- Which DB fields are you interested for -- Which OD Table MAP to fill -- Which OD Fields MAP to create or to use (if already existing) -- Selecting objects -- Retain only objects which the correct parameters -- ACTION ... Copy Data to OD fields ... append DWG & MDB files as example. thanks for the help you can give me, greetings EJEMPLO.zip
  25. Hi all, is it possible to read attributes or properties from the _DWGPROPS and list them in a Lisp e.g. as variables? I need the yellow marked attribute (OD2485), which always has a different number. (defun c:dropsforatts () (setq (vla-get-ActiveDocument (vlax-get-acad-object)) (vla-get-SummaryInfo doc) ) (setq i 0) (setq i 5) ) I would then like to insert this variable into a file path in a Lisp. (defun c:tempsave () (getvar "DWGNAME") (getvar "DWGPREFIX") (command "_+saveas" "G" "2018dwg" "2018(LT2018)" ("F:\\\\Clients\\CT2485\\OD2485\\Planning" ;i need the OD2485 as a variabel from the DWGPROPS (strcat (substr (getvar "DWGNAME") 1 8) "_temp") ) ) )
×
×
  • Create New...