Jump to content

Search the Community

Showing results for tags 'layer'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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


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

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...

Found 94 results

  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. 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 ?
  3. I want to delete Xref-dependent layer. AutoCAd says I can't delete them. I want to delete them. How can I do that?
  4. What is the problem? It's not working when am offsetting its not coming, (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq ilyrc(getstring(strcat "\Specify insulation layer <" (vl-princ-to-string ilyr)"> : "))) (setq layers (vla-get-Layers doc)) (setq ilyr (vla-Add layers ilyrc)) (setq plyr (vla-get-ActiveLayer doc))) (function (lambda (x) (vla-offset x (+ *ff)) (vla-put-layer (vlax-EName->vla-Object (entlast))plyr) (vla-offset x (+ iszo)) (vla-put-layer (vlax-EName->vla-Object (entlast))ilyr) (vla-offset x (- *ff)) (vla-put-layer (vlax-EName->vla-Object (entlast))plyr) (vla-offset x (- iszo)) (vla-put-layer (vlax-EName->vla-Object (entlast))ilyr)))
  5. Find and correctly map wrong layers in ACAD group Hi, I have a problem with layers grouped in Acad groups. These layers are partially in the wrong group. Short description: There are several groups in my drawing in which different layers have to be grouped uniformly. Certain groups must contain specific layers. For example, a group includes layers that are somewhere in the layer name "Layer 1". There is no layer in the drawing that does not belong to a group. There must be no nested groups. For example, in: Group A will be all Layer 1. In group B all Layer 2. In group C all layers 3. etc....... However, it can happen that a wrong layer or several wrong layers were mistakenly assigned to a group. How can I find the wrong layers in the groups and remove them from the groups and then the right one Assign groups? A solution would be a great help. Martin Beispielzeichnung.dwg
  6. Alan_KD

    XREF layer

    Hello everyone, I have been developing some routines for the pas 6 months, so my knowledge is not very high. Normally I manage to find answers online, thanks to all of you who share their knowledge, it's so helpful. I am writing a routine which would: Compare the XREF name on the drawing and the XREF 'real' file name and match them (on the drawing) if different. After the code checks if the XREF name matches a specific formatting and if it does creates a layer based on it (if the layer does not already exist). The final step is to change the XREF layer to that one, and here is where I am getting an error. I tried with different ways to do this and always got an error. I guess I could try to get this done without using vl code but this is really puzzling me and I would like to know why is actually not working, I dont see where the code could have gone wrong. The example names of my XREFs: which are used to compare with the wcmatch "*_*_*_*" XREF_TGLMTE_PRO_INTER_BASSINS_01 XREF_TGLMTE_PRO_INTER_RESEAUX_HS_2025_01 XREF_TGLMTE_PRO_TRC_V5_IND_D I used different lines of code to try to achieve this, as you can see on my commented lines on the code. I am currently using a (vlax-put-property it2 'layer strcalq) inside a vlax-for getting the following error: (defun c:xrcalque (/ AcadObj AcadAct LyAct it2 xrobjectname strcalq) (vl-load-com) (setq *error* ABD:Error) (setq AcadObj (vlax-get-Acad-Object)) (setq AcadAct (vla-get-ActiveDocument AcadObj)) (setq LyAct (vla-get-layers AcadAct)) ;get layers from Active document (xrn AcadObj AcadAct); runs the subroutine to change XREF name on drawing to match XREF file name (vlax-for it2 (vla-get-blocks AcadAct) (setq ind1 3) (setq ind2 0) (setq ind3 0) (if (= (vla-get-isxref it2) :vlax-true) (progn (setq xrobjectname (vl-filename-base (vla-get-name it2))) (if (wcmatch xrobjectname "*_*_*_*"); (progn (repeat ind1 (setq ind3 (+ ind2 1)) (setq ind2 (vl-string-position (ascii "_") xrobjectname ind3));gets firs position of "_" character ) (print xrobjectname) (setq ind2 (+ ind2 2)) (print ind2) ; ind2 is the position of the ind1 "_" element (3rd) to count from there to have the layer name (setq ind4 (vl-string-position (ascii "_") xrobjectname nil T)); last "_" position (setq ind5 (vl-string-position (ascii "-") xrobjectname nil T)); last "-" position (if (> ind4 ind5)(setq indlst ind4)(setq indlst ind5)) ;check which one is bigger (setq indlst (+ 1 indlst)) (setq strcalq (strcat "SF-XREF_"(substr xrobjectname ind2 (- indlst ind2)))) ;Create layer with string from ind2 position to ind4 or ind5 position (strcalq) (print strcalq) (if (not (tblsearch "LAYER" strcalq));checks non existance of layer (progn (vla-add LyAct strcalq) (print "Layer has been created") ) (progn ;(vla-put-layer it2 "0") ; (print "this is a test4") (print "layer exists") ;if layer exists put object on layer ) );if (print strcalq) ;(vla-put-layer it2 "0") ;(vla-put-layer xrobjectname strcalq) ;(vla-put-layer (vla-get-name it2) strcalq) ;(vlax-put it2 'Layer "0") ;(vlax-put (vlax-ename->vla-object (vla-get-name it2)) 'Layer "0") (vlax-put-property it2 'layer strcalq);############ ERROR############### );progn (print "wcmatch xref name not matching") );if );progn );if ;(vlax-put (vlax-ename->vla-object xrtemp) 'Layer strcalq) );vlax for (print "highly recommended to purge layers") ;add code to purge automatically the layers? (princ) );defun ;;;======================================= Error function ++++++++++++++++++++++++++++++++++++++++;;; (defun ABD:Error (st) (if (not (member st (list "Fonction annulée" "quitter / sortir abandon"))) (vl-bt) );if ;(princ "Merci d'envoyer vos commentaires ou report d'erreurs à ") (princ);clean exit ? );defun error ;;;======================================= function xrn +++++++++++++++++++++++++++++++++++++++++++;;; (defun xrn (AcadObj AcadAct / item xrobjectnamexrn xrfilenamexrn) (vlax-for item (vla-get-blocks AcadAct) (if (= (vla-get-isxref item) :vlax-true) (progn (setq xrobjectnamexrn (vl-filename-base (vla-get-name item))) (setq xrfilenamexrn (vl-filename-base (vla-get-path item))) (if (/= xrobjectnamexrn xrfilenamexrn) (progn (vla-put-name item xrfilenamexrn) (vla-reload item) ) ) ) ) ) );defun xrn If someone could explain why this is not working, and please share a way to achieve my goal would be awesome! Thank you in advance, Alan
  7. hi, any way to improve below lisp? it create new layer and new viewport but after layerp command execute the layer color goes back to white and no plot becomes plot again. (defun c:vp() (command ".layer" "M" "viewport" "C" "8" "viewport" "P" "N" "viewport" "" "-VPORTS" pause pause ".layerp") (princ) )
  8. Currently the view port color over write doesn't effect the colors of nested blocks. The nested blocks show the global color of the layer. Ideally VP color over write should behave same as changing global color of layer. Is there a way to achieve it (beside exploding the blocks to remove nesting). For example see attached sample file. I want all elements in the blocks to have the overwritten color in the view port i.e. color 20, instead it is showing the nested blocks as yellow which is not what i want. sample.dwg
  9. First of all, I'm not asking anyone to write this for me... I'm asking if they can point me to an existing routine if it indeed exists.. I have a legacy drawing where everything is on Layer 0 and all the entities have colors assigned to them. I am looking for an existing routine <Hopefully!> that will take all the red objects and move them to a new layer called 1 for color 1. Same thing for each color used in the drawing. When done, nothing would be on Layer 0. I've looked and in my searching I've had no luck. = = I did find this: http://forums.augi.com/showthread.php?110777-Select-by-colour-and-move-to-layer I login to the site, my name appears but when I go to this page, it does not show me logged in (so I cannot look at the code) I pick Login, it takes me to the main page (and shows me logged in) I cannot click the link..
  10. User is running AutoCAD 2017. Every so often after closing AutoCAD, and restarting it, the layer palette positions itself as shown in the screenshot with no user interaction. Even more bizarre, user was just given a NEW PC with a fresh install, and no "migration" was done. This still happens on new PC occasionally. Any thoughts?
  11. (sssetfirst nil (ssget "_X" '((8 . "5")))) will select objects in layer 5 no problem but when i incorporate (getvar "CLAYER") to make: (sssetfirst nil (ssget "_X" '((8 . (getvar "CLAYER"))))) It comes back with error: ; error: bad SSGET list value It's probably just a simple fix (heck, maybe even a standard command to do the same) Thanks in advance.
  12. 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.
  13. Hi all, I have a layer consisting of 30k block references. I want to export the properties of all these block references into Excel sheet or txt. Does anyone know a LISP routine to do this? The sample drawing is attached with this thread Thank you in advance. Best wishes, Jes G Sample.dwg
  14. Hi there, here a thing I want the do with LISP: I want to change multiple Objects with different Layers, that each Layer change to a different Layer. Example: Select entities with (ssget "_:L" '((8 . "Layername1, Layername2, etc"))) Now change Layer: Layername1 → 1_Layername1 Layername2 → 1_Layername2 I don't want to select each entity and than change its Layer. I want to do all entities at the same time with one command.
  15. Hi. Can someone please help me, tell me or explain to me how to create new layer with macro. I want define a new button which when I push it will make new layer and ask me for define name and colour of new layer. I'm kind a new to this. I found only this code using LISP. But I want macro for button. (defun c:SetLayer (/ name col) (if (setq name (getstring t "New layer name: ")) (if (tblsearch "LAYER" name) (progn (prompt "Layer already exists, set as current.") (setvar "CLayer" name)) (if (setq col (acad_colordlg 7 nil)) (progn (entmake (list '(0 . "LAYER") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbLayerTableRecord") '(70 . 0) (cons 2 name) (cons 62 col))) (prompt "Layer created and set current.") (setvar "CLayer" name))))) (princ)) Thank you for your time guys and have a nice day
  16. hello, well i'm working on several floor, we got a block made by apartment, in each apartment, we gad lot of blocks, like exemple "bed", i'd like to select all the bed in one time to change the layer of this block, i don't want to enter the edit_block to change the layer of the lines, but to have the block "bed" set into the layer "mobilier" as an exemple, the filter selection by name do not recognize the block into a block, and neither the qselection. i hope someone can helpme, thanks it's my first post, and i don't speak english very often, so i'm sorry for my errors...
  17. Hello, My manager made this LSP file for me and it doesn't work and we are both not sure why. Seems correct to me. How it works: Creates the E-Anno-Note layer, otherwise makes it current, then creates an MLeader (to avoid creating leaders on incorrect layers). (DEFUN C:NN () (setvar "cmdecho" 0) (if (not (tblsearch "layer" "E-Anno-Note")) (command "-layer" "n" "E-Anno-Note" "c" "2" "E-Anno-Note" "")) (command "-layer" "m" "E-Anno-Note") (COMMAND "mleader") (princ) ) Thanks!
  18. My drawings have multiple layouts with multiple View Ports in each, the drawing has a few Layer States set up (mainly made up of VP freezes). Within each layout all different layer states are used in various view ports. Problem is when I have to update a layer state they don't automatically update all the view port using the same layer state. I have to individually click into each view port and restore the state via the layer manager the (there are hundreds of view ports). Is there a variable I have to set (my VISRETAIN is set to 1 and would like to keep at 1)? How can I make the layer state apply changes to all view ports (if not the whole drawing then layout by layout would help) using the same layer state when updated?
  19. Is it possible to select objects by layer using only the command prompt, I know it is possible to select objects by other means but I'm specifically trying to use the command prompt to run a script which will go on to cleanse dxf files. If not, does anyone now of a lisp routine which would enable this to work? Can lisps be called in scripts (have never tried)? Trying to select objects (blocks) to scale them to their correct size, now I'm sure their are other ways of doing this too but for some reason these particular blocks are "phantom" for want of a better word. And, cant be edited by double clicking them! The general idea is to cleanse the data as much as possible (set layers, colours etc) with no input from the end users. Hope the above is clear and thanks in advance for any and all help
  20. Hi, I want to make a script who draw circles in multiple Points. The Points are automaticly made in a extension to autocad. All the Points are in same layers. It´s around 200 to 1000 Points in the drawing. My first issue is to find a commando who draw circles, with basepoints in all Points. Does anyone know the appropriate command for me? Regards, Emil
  21. RubberDinero

    Change entity layer

    At my job, i have a very tedious job of changing layers from proposed to existing and vice versa our layer setup is very basic "LayerName"=existing layer "LayerName-PR"=Proposed layer. i have recently bought a book to to learn AutoLisp and I've gotten the basic concept. I know that i want to ssget LayerName and setq that name to L then CHPROP LA to L-PR. but i want to know if someone has anything like this already and could help me. I'd like to do a mass select and have it automatically change the entities to their respective PR layer. also vice versa, to remove PR. i'm not looking for a layer renaming lisp. i'm looking for a entity layer changing lisp. anything helps. thanks.
  22. Hi Everyone:) I am working with contour lines. I don't have any trouble creating a surface from the contour lines (Toolspace > GIS topo > Definition > Contours > Add (with swapping edges selected) >> surface generates). What I was wondering is : IS there any way to create different layers for different slope gradients (as defined in the slope properties)? Ultimately what I want to do is be able to isolate the regions that fall into different slope categories and create boundaries around them. Any and all help is greatly appreciated!
  23. DesmetMartin

    What layer is the object?

    Hi! My question is, when you have a block, in a block, in a block,... How can you know, by only clicking one time, in what layer a specific block or line is? Thanks! - DM
  24. I have a series of drawings that I am now in charge off and three or more people have worked on it. I have changed all of the layers on the drawing to my layers. but there is 50 or more layers from other people editing these drawings. is there any way to remove the layers at once or can I only remove them one at a time with LALDEL? I appreciate any help.
  25. 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.
  • Create New...