Jump to content

Search the Community

Showing results for tags 'layers'.

  • 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 Is there any way to export all layers separately into pdf format? i want to export all of them at once to edit them in illustrator. It's taking alot of time to export them one by one from autocad I don't have any professional Experience with programming but i have tried to made this .lisp with chatGPT but it's not working to export files which property in codes needs improvements please (defun c:ExportLayersToPDF (\Users\Useer\Desktop\pdf layers) (setq dwgname "EMERALD HILLS MP (2007) 25 01 2023") ; (setq dwgpath "F:\Shahtaj Ahmed Bhutto\AUTOCAD") ; (setq layname "") (while (setq layname (tblnext "LAYER" layname)) (and layname (/= layname "0") (/= layname "DEFPOINTS") (/= (logand (cdr (assoc 70 (tblsearch "LAYER" layname))) 1) 1) (progn (setq pdfname (strcat dwgname "_" layname ".PDF")) (setq pdffullpath (strcat dwgpath pdfname)) (command "-plot" "Yes" "Model" "" "" "DWG To PDF.pc3" "A0" "PORTRAIT" "Inches" "Fit" "Center" "No" "No" "No" "Yes" "No" "No" "Yes" "Yes" pdffullpath) T ) ) ) (princ) )
  2. I have similar blocks of drilling points on a map and wish to assign them to different layers to color them differently. How can I select blocks by their name, or part of their name, instead of handpick the individually? I also have Civil3D if that helps Thank you
  3. Hi all, I have a program to create circles from one point. It basically helps to draw a survey from running dimensions by entering all those and this spits circles out to those dims. There's a defun I got to create and update layers. The only thing I've added to that is adding a layer description. Here's where I get the defun (It's from @ronjonp ). It this some sort of localisation issue? Anyway, here's my full program below. PROBLEM: If I change the layer properties (color, linetype or description) the defun doesn't update them when I run my program. (vl-load-com) (defun c:--LDSurvey_Circles ( / ) (progn (LOAD "3dwannab_Survey_Circles"))) ;; -----------------------=={ Survey_Circles }==-------------------------- ;; ----------------------------------------------------------------------- ;; AUTHOR & ADDITIONAL CODE ;; Author: 3dwannab, Copyright © 2022 ;; Credit to ronjonp for the function to create or update layers. ;; ABOUT / NOTES ;; - Creates a set of circles from one chosen point. ;; - Creates a named layer that is coloured, DASHED and doesn't plot with a ;; layer description. ;; - This is handy for when you are drawing a survey and you have the survey in ;; running dimensions. ;; - Can also be useful for drawing an inner and outer circle, like a Donut. ;; Which is unlike the AutoCAD command that creates a thick arced Polyline. ;; USAGE ;; - Fist prompt with ask for the location for all the circles. ;; - Then a prompt will show to enter each of the circles radius' separated by a ;; space. ;; - For example. Entering '100 200 555' will create 3 circles with those three ;; circles in the string. ;; FUNCTION SYNTAX ;; Short-cut CIRS ;; Long-cut Survey_Circles ;; VERSION DATE INFO ;; Version 1.0 26-08-2022 First written ;; TO DO LIST ;; - BUG - Where the layer exists and it changed. Running this program will not ;; update it. ;; ----------------------------------------------------------------------- ;; -----------------------=={ Survey_Circles }==-------------------------- (defun c:CIRS nil (c:Survey_Circles)) (defun c:Survey_Circles ( / *error* acDoc cirRadiuses cirRadiusesStr layName ptCircle r ) (defun *error* (errmsg) (and acDoc (vla-EndUndoMark acDoc)) (and errmsg (not (wcmatch (strcase errmsg) "*CANCEL*,*EXIT*")) (princ (strcat "\n<< Error: " errmsg " >>\n")) ) (vla-StartUndoMark (setq acDoc (vla-get-ActiveDocument (vlax-get-acad-object)))) (princ) ) (princ "'CIRS' or 'Survey_Circles' command ran..\n") ;; Start the undo mark here (setq acDoc (vla-get-ActiveDocument (vlax-get-acad-object))) (or (vla-EndUndoMark acDoc) (vla-StartUndoMark acDoc)) ;; Set up variables (setq ptCircle (getpoint "Pick a point for the survey circles : ")) (setq cirRadiusesStr (getstring T "Enter the radiuses here separated by spaces : ")) ;; Split the string into a list (setq cirRadiuses (splitStr cirRadiusesStr " " " ")) ;; Make a new layer that is green, DASHED and doesn't plot with description (setq layName "Survey Circles") (_addOrUpdateLayer layName 100 "DASHED" 0 "Temp layer for survey circles") ;; Loop the cirRadiuses variable (foreach r cirRadiuses (progn (entmake (list '(0 . "circle") (cons 8 layName) (cons 10 ptCircle) (cons 40 r) ) ) ) ) (vla-EndUndoMark acDoc) (*error* nil) (princ) ) (princ) ;; Help with splitting a string https://www.cadtutor.net/forum/topic/66221-how-to-split-a-string-by-character/?do=findComment&comment=543913 ;; str = Input String, d = Delimiter, s = Character to use as the splitter (defun splitStr ( str d s / ) (read (strcat "("(vl-string-translate d s str)")")) ) ;; Creates a new layer or updates an existing one if it exists. ;; Will attempt to load the linetype if found in the acad*.lin file and if the layer exists, it will update the properties. ;; Code by ronjonp, taken from: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-layer-with-true-color-in-lisp/m-p/7904814#M367339 ;; Usage: ;; (_addOrUpdateLayer "NewLayerName" '(69 69 69) "3Dash2" 1 "Description goes here") ;; (_addOrUpdateLayer "NewLayerName2" 169 "3Dash2" 0 "Description goes here") ;; NOTE: ;; The 0 or 1 in examples above is for plot on = 1 or plot off = 0. ;; Modified by 3dwannab on 2022.06.11 to add description to the function. (defun _addOrUpdateLayer (name color ltype plot desc / _loadlinetype _rgb _setLayDescription d e) ;; RJP - 04.03.2018 ;; Creates or updates a layer (defun _rgb (l) (+ (lsh (fix (car l)) 16) (lsh (fix (cadr l)) 8) (fix (caddr l)))) (defun _loadlinetype (linetype / lt out) (cond ((tblobjname "ltype" linetype) t) ((setq lt (vla-get-linetypes (vla-get-activedocument (vlax-get-acad-object)))) (setq out (vl-catch-all-apply 'vla-load (list lt linetype (findfile (if (= 0 (getvar 'measurement)) "acad.lin" "acadiso.lin" ) ) ) ) ) (not (vl-catch-all-error-p out)) ) ) ) ;; _setLayDescription added by 3dwannab on 2022.06.11 (defun _setLayDescription ( name desc / ) (setq layerobj (vla-add (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) name)) (vla-put-description layerobj desc) ) (setq d (apply 'append (list (if (setq e (tblobjname "layer" name)) (entget e '("*")) (list '(0 . "LAYER") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbLayerTableRecord") '(70 . 0) ) ) (list (cons 2 name) (if (listp color) (cons 420 (_rgb color)) (cons 62 color) ) (cons 6 (if (_loadlinetype ltype) ltype "continuous" ) ) (cons 290 plot) ;; 1 = plottable 0 = not=plottable ) ) ) ) (if e (entmod d) (entmakex d) ) (if name (_setLayDescription name desc) ) ) (princ (strcat "\n3dwannab_Survey_Circles.lsp Loaded. Invoke by typing 'CIRS' or 'Survey_Circles'")) (princ) ;; (c:Survey_Circles) ;; Uncomment for quick testing only ;;----------------------------------------------------------------------;; ;; End of File ;; ;;----------------------------------------------------------------------;;
  4. Hi Guys, I need a Help here i have created a autolisp for insert Blocks , in this i am showing invalid layers for user I.e block not available for that layers. But my problems is if same layer found more then one it will repeat for all same layers i don't want to show error for every same layers. Please help me (defun c:parkingblock(/ addblock ss acaddocument space i snm lnm pos) (vl-load-com) (defun addblock (sp pos nm lname en / b) (setq b (vla-insertblock sp pos nm 0.1 0.1 0.1 0.0)) (vla-put-layer b lname) (vla-delete en) ) (if (setq ss (ssget '((0 . "POINT")))) (progn (setq acadDocument (vla-get-activedocument (vlax-get-acad-object))) (setq space (vla-get-modelspace acadDocument)) (repeat (setq i (sslength ss)) (setq snm (vlax-ename->vla-object (ssname ss (setq i (1- i))))) (setq lnm (vlax-get snm 'layer)) (setq pos (vla-get-Coordinates snm)) (cond ((= lnm "P_SEM_P") (addblock space pos "937" "P_SEM_P" snm)) ((= lnm "P_ILL_P") (addblock space pos "950" "P_ILL_P" snm)) ((= lnm "ALB_P") (addblock space pos "968" "ALB_P" snm)) ((= lnm "P_TEL_P") (addblock space pos "980" "P_TEL_P" snm)) ((= lnm "ZSD_P") (addblock space pos "953" "ZSD_P" snm)) ((= lnm "DIS_SOST") (addblock space pos "926" "DIS_SOST" snm)) (t (princ (strcat "\nBlock not found for Layer: " lnm)));; Problem ) ) ) ) (princ)) Regards, Ganesh
  5. Hi, Why sometimes this operation returns wrong: (defun c:cvt() (setq oldname "ESP - Esquadrias CIR")(setq newname "ANT - Esquadria Círculo")(runtorenamelayer) ) (defun runtorenamelayer() (if (and(tblsearch "layer" oldname)(not(tblsearch "layer" newname))) (COMMAND "._-RENAME" "LA" OLDNAME NEWNAME);;(command "._-layer" "R" oldname newname "") ) (if (and(tblsearch "layer" oldname)(tblsearch "layer" newname)) (progn (command "Laymrg") (foreach e (list oldname) (if (tblsearch "LAYER" e)(command "_Name" e)))(command "" "_N" newname "_Y") ;;(command "_.-PURGE" "_La" oldname "_N") ) ) (princ) ) Being specific, if I load the code with the appload or even in the ACAD.LSP the problem occurs. And the result is a strange name: ANT - Esquadria Círculo If I just copy and paste the code into the command bar it works fine and te name is ok: ANT - Esquadria Círculo Ok, I am thinking about avoiding special characters in the new Layer names, but in some cases the old layers have them already, and in this situation the operation doesn't rename that old layers, the application just skip them because the names doesn't match. TIA
  6. Good morning, Hello, this is probably a very easy answer (newbie and all, bear with me please) but, I received a drawing from another office and, upon opening in my 2018 CAD, the layers showing the door and window sizes appears to lose whatever reference or standard that is attached. I'm not actually sure how to properly describe the issue, frankly. The architect whose drawing it is, mentioned that perhaps it was an issue with the dynamic tags they use for window and door sizes on drawings. I've included a photo screen shot for reference (hopefully it's posted correctly). What can I do? Do I need to request a supporting document? Thanks!
  7. Hi! Sorry if this is a really dumb or basic question. New (again) to AutoCAD -haven't used since 2006 so I am very rusty. Problem here is something I am sure is pretty simple to fix but I can't figure this out. I have two dwg's from both the architect and the designer. When I open either of the files I get a Proxy Information alert about an unavailable ObjectARX application. Then it alerts me that one or more reference files could not be located or read. If I try to open the External References palette, I get unreconciled new layers. When I am finally in the dwg, I can't access the lines to modify any of them. The only accessible layer seems to be the architect's and the designer's masthead layers. All other layers seem to be locked but I have tried doing everything from auditing and purging, I made sure Layer 0 was not frozen or locked, I have unlocked and thawed every layer but nothing allows me access to either drawings layers other than their mastheads. What simple thing am I missing to access the other layers in these files? Thanks for any input!!! My boss wants some changes made to these drawings for Monday to submit back to the architect and I'm not a designer anymore and my autocad knowledge is pretty bad now
  8. Print_Master

    Can't remove "Defpoints" Layer

    The drawing that I am working on only consist of one machine on "Zero" Layer. I am trying to get the drawing to only have one layer (Layer 0). I was able to remove all the other layers , but I am having trouble finding a way to remove "defpoint" layer:(. Does anyone know how to remove a "defpoint" layer from a drawing? Thank you to all that helps.
  9. hello guys !! im trying to import Points from Leica device and i want to creat a layer for each Point depending on its code ,if anyone have ideas how to do it i will be thanksfull best regards !!!
  10. I used to have this really handy lisp but have switched companies and forgot to bring it with me. The command was LPO and it would turn every off layer on, even xref, and I would be able to individually click the layers that I wanted to remain on. After clicking enter, the other layers would return to the off state. One of the most useful routines I have ever seen. I have very basic knowledge of lisp around would really appreciate some help. I also did a search and couldn't find anything similar. Thanks in advanced.
  11. Hello, I'm very new to LISP and wanted a hand with writing a simple script to copy a line and change the layer to a specific layer. It going from Layer "50" to "TRAV" and I wanted this changed line copied on to of itself. I have a pretty good understanding of TCL as I have written in that when using Surpac but I'm at a new job now and trying to educate myself with a few basic but useful scripts. Any help will be great.
  12. Hello I am trying to understand the logic behind the display of 2D solid surfaces in autocad 2000. if you have a same area covered by different 2d surfaces in different layers with different colour which layer or surface hides what surface or layer. Does it depend on the order they are created, does it depend on the colour , is there a method to make one layer cover another. All layers must be on. And what about lines that cross these surfaces , some times they show and some times they don't. Is there a logic behind this? Thanks in advance for your answers
  13. Hi, I have my xref-drawings with many layouts with even more viewports. In all these viewports i wanna show different kind of information and therefore i have to freeze some of the them, depending of what i want to show ofc. Now i just realized i have to change all my layer names from the orginal drawing, and when i do that all the freezed layers unfreezes in my xref viewports. for ex. All my layers starting with B_..... and now i wanna change that to X_... but i still wanna keep the layers frozen/unfrozen on the particular viewport in my xref-file. I Hope you guys understand what im trying to say and hopefully someone will save me from this ¤!%"&/ :)
  14. There are 2 layers on this sample that QuickSelect says have nothing on them... Yet I cannot delete them. I've WBlocked, purged, dlete from Layer Prop Manager... I have hundreds of these I'm working on! Overall a relative newbie in CAD, not really digging LISP right now... so please try to keep solutions fairly straight forward. Layers are: FX-SGNSYM Bick Thank you half W32.dwg
  15. Hi I've been looking for a LISP that will create a new layer with a given name ("DATA EXTRACTION") every time I open up a dwg (unless that layer already exists) and make that layer current. I have found a couple of similar LISP routines but they don't do just that. Any help much appreciated.
  16. DesmetMartin

    Layer Lisp Question

    I have a Lisp from Lee Mac which I would like to be modified. I would like to have a setting that let's you choose which layer it should be on. I have tried to write something myself and only came up with this: ****************************************************************** (setq TASH (getint "\nChoose dimensions layer: Dim. (1), Front view (2)")) ); end while ); progn );TASH = 1, Dim (if (= TASH 1 ) (progn ; S-Dimensions (command "DIM*" "S-DIMENSIONS" "Dimension Layer" 3 "Continuous" -3 1 nil ) ); progn ); if (= TAMR 1) ****************************************************************** and: ****************************************************************** (defun CommandReactor:CommandWillStart (rea cmd) (if (wcmatch (strcase (car cmd)) "*DIM*") (progn (setq *OldClayer* (getvar 'clayer)) (vla-add (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (setq TASH (getint "\nChoose dimensions layer: Dim. (1), Front view (2)")) ); end while (setvar 'clayer layerName) ) ) ) ****************************************************************** But I don't know were to put it in the existing lips from Lee Mac. Can anyone help? The lisp from Lee Mac is now; ****************************************************************** http://lee-mac.com/lisp/html/LayerDirectorV1-4.html ****************************************************************** Thanks!! Ps. Check out Lee Mac's lisps!
  17. Hello All, I have looked around a little bit and haven't been able to find the answer I am looking for. I know commands like LAYTHW AND LAYON. I also used the info from "Michael's Corner" latest post. Everything is turned on and everything is thawed. However, it does not thaw layers that are labeled as VP Freeze. Instead of going to the layer properties manager, select all, and thawing the layers that are frozen in the view port freeze, is there a way to thaw all of them with a simple command or a button that is already created or one that I can make in the CUI? As always, any and all comments are appreciated. I have a feeling ReMark, BlackBox, BIGAL may have some insight in to this, or at least point me in the right direction.
  18. I have this routine (unknown to the author). Thank you for your help with the following change: Export the list of layers but only on a selection. (defun c:LL2T ( / oecho clrlst dwgnm fn fh lyr lyrlst) (defun chkbit (bit_val num) (not (zerop (logand bit_val num))) ) (setq oecho (getvar "cmdecho") clrlst (list (cons 1 "RED") (cons 2 "YELLOW") (cons 3 "GREEN") (cons 4 "CYAN") (cons 5 "BLUE") (cons 6 "MAGENTA") (cons 7 "WHITE") ) dwgnm (getvar "dwgname") ) (setvar "cmdecho" 0) (setq fn (getfiled " File name: " (strcat dwgnm ".LS") "LS" (+ 1 2)) ) (while (setq lyr (tblnext "layer" (not lyr))) (setq lyrlst (cons (cdr (assoc 2 lyr)) lyrlst)) ) (setq lyrlst (acad_strlsort lyrlst)) (princ "\nWriting layer data to file...") (setq fh (open fn "w")) (princ (strcat dwgnm ".DWG\n") fh) (foreach x lyrlst (setq lyr (tblsearch "layer" x) lyrname (cdr (assoc 2 lyr)) lyrclr (cdr (assoc 62 lyr)) lyrlt (cdr (assoc 6 lyr)) frzn? (chkbit 1 (cdr (assoc 70 lyr))) lokd? (chkbit 4 (cdr (assoc 70 lyr))) ) (if (minusp lyrclr) (setq on? "OFF" lyrclr (abs lyrclr) ) (setq on? "ON") ) (if (assoc lyrclr clrlst) (setq lyrclr (cdr (assoc lyrclr clrlst))) ) (if frzn? (setq frzn? "FROZEN") (setq frzn? "THAWED") ) (if lokd? (setq lokd? "LOCKED") (setq lokd? "UNLOCKED") ) (princ lyrname fh) ;;(princ "," fh) ;;(princ lyrclr fh) ;;(princ "," fh) ;;(princ lyrlt fh) ;;(princ "," fh) ;;(princ on? fh) ;;(princ "," fh) ;;(princ frzn? fh) ;;(princ "," fh) ;;(princ lokd? fh) (princ "\n" fh) ) (princ "done.") (close fh) (setvar "cmdecho" oecho) (princ) )
  19. Ryan Lindsey

    Export Drawing Layer Properties

    I'm looking for a simple way to export layer settings from one drawing to another. I know that you can export styles by right-clicking them in the styles editor but when I get down to layers it will only let me do them one-by-one. Is there an easier way? Is there a way to export ALL styles as one .styxml file? Or, as an alternative, is there a way to change the default ANSI layer properties? Any response is greatly appreciated!
  20. Hello I'm new to CAD and have set up a few different wall styles (stud, block etc..) Does anyone know of a way to when you select the stud wall style to automatically place that on a stud layer? I have tried to search for an answer but I'm unsure of what to search. Thanks in advance. Andrew
  21. Hola! Sorry if I'm posting this in the wrong place... I did search for this before posting, but didn't see anything relevant. First of all, I'm an AutoCAD guy. I only know enough about Inventor to be very dangerous. At the company I work for (manufacturing) the Design team (me) uses AutoCAD to create our space planning blocks. This is pre-sale activity. The Engineers model everything (post sales) in Inventor. Occasionally I will be asked to draw something that is "just like that other thing we did," so I will open up Engineering's model of that thing and export to DWG to use from there. For rendering and quoting we use a 3rd party software that manages information via layers. For example, a work surface face is on a specific layer, the edge is on a specific layer, the powdered components are on a specific layer, etc, etc... When I export from Inventor, the DWG file is VERY detailed, down to the screws, but everything is on the "0" layer. This really sucks because I have to spend a ton of time dissecting the block in order to assign the correct layer information to every bit of geometry. I noticed the other day though, that when I switched to a realistic or conceptual visual style, the freshly exported Inventor block retained all the sweet info... like it was showing details down to the grain direction of the surface. My question to you guys, is if you know of an easy way to get that info converted to layer? Whether that be in CAD after I export or from within Inventor in my export. Ideally there's already an LSP or something similar that can do this in a button press.
  22. I have been designing for 18 years and am tired of wasting time when importing surveys into my drawings. I have my own layer system for my home plans, and only use about 20 layers total. I like my drawings clean and simple. When a surveyor sends me the survey, their CAD file has about 50 layers, none of which I want or need. So what I have been doing for many years is spending about 30 minutes changing everything on the survey to layer 0 and then copy/pasting the survey into my drawing. The problem is, some of the surveyor's stuff is in blocks, so I also have to explode the block in order to change all the elements to layer 0. I would love to know if there is a simpler method to all this. I really don't like having 50+ layers in my drawings. I can consolidate everything on a survey into about 5 layers that I use (natural features, boundary and easement lines, buildings, flatwork, text, etc). Thank you for your help.
  23. I am trying to assemble a few components. I'm drawing on a 2D Wireframe, and mounting some components on top of rails. See picture below Now, the red crossbars are at the back, with the white rails on top of them. The electrical blocks (blue w/ yellow text and red wiring) should be mounted on the (white) rails. I want to hide the rail sections that are behind the electrical blocks, and hide all the crossbars that are behind a block or a rail. How do I do this? Ordering? Transparency? I have everything in different Layers currently, but I can change the Layering however I like
  24. Hello All, I work with projects that require several layers. I was wondering if anyone knows of a way to automatically create x number of layers with names like "name_1," "name_2," "name_..." "name_n-1," "name_n" without having to manually input each layer's name. Furthermore, I need each layer to have a different color. Again, is there a way to assign different colors automatically without having to go in and do it manually layer by layer? You all have been very helpful so far and I appreciate the time you take to help me become a better CADer. Best Regards, Beef
  25. Hello All, I've seen many posts about this issue and they seem to be resolved easily, but these solutions seem to not apply to my issue. My lineweights are not displaying properly in MS. I have set the layers' lineweights to 0 mm in Layer Properties Manager. I have turned on the Show/Hide Lineweight button. The lines are still showing too thick and this is a problem for me. The Layer Properties Manager is showing that they are indeed set to 0 mm thickness (lineweight), but the drawing is showing otherwise. Any ideas? Solutions? As always, thanks, Beef
×
×
  • Create New...