Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. Hi every one. I want to use initget to get the plot style from the user. In the code, the styles after Screening_50.ctb are not known by the Autocad. the same thing happens when I add Fill_Patterns.ctb before Screening_50.ctb. how do I solve the problem? (initget 1 "Monochrome.ctb acad.ctb Grayscale.ctb Screening_50.ctb Fill_Patterns.ctb") (setq plotstyle (getkword "\nChoose plot style [Monochrome.ctb/acad.ctb/Grayscale.ctb/Screening 50%.ctb/Fill Patterns.ctb] <Monochrome.ctb>: "))
  3. Today
  4. Good day everyone! I've discovered new (old?) the possibilities of a true rectangle. It is very convenient to work with him! The only drawback is that the rectangle is unstable. You can create it and work with it only in the current file. If you then close and open this file, the properties of the true rectangle are lost. Is it possible to make it stable so that its properties are preserved? https://autocadtips1.com/2011/11/20/autolisp-make-a-real-rectacgle/ AutoLISP: Make a Real Rectangle Posted on November 20, 2011 by AutoCAD Tips A long time ago, AutoCAD used to make Rectangles and polygons as their own entities. When you made a rectangle and then did a LIST <enter> on it, it would show as a rectangle. Nowadays, these objects are those objects in their geometry but are made of polyline entities. So modifying these objects is sometimes hard. that’s where this routine steps in to help. This routine lets you create a rectangle and even after you continue working elsewhere in your drawing, you can come back to that rectangle and modify that object and it acts like how rectangles used to act in AutoCAD. Here’s how: TREC <enter> to start “True RECtangle” Create a rectangle how you normally create one When needed, this routine will let you drag a single corner and the rest of the rectangle’s geometry will adjust accordingly to keep its geometry as a rectangle. TrueRect.lsp
  5. Yes, this will substitued all layers into the UPPERCASE.
  6. If I getted correct, this can be accomplish, but you need to do a systematization in naming the layers. One of the approaches can be to make an .txt file in which you will store the systematizated layers (the proper order must be, for e.g. "Tropic,Train,Traffic" or "Tropic\n" "Train\n" "Traffic\n" etc. The \n means new line). Then, you will run the code from my post, get an list of layers inside the drawing, then select desired layers to matches with .txt file from which you want to get a proper names (for e.g. in .txt file you have the layer name "TrAffiC", after choosing the layer "Traffic" in the drawing with "TrAffiC", you can substitued with proper name).
  7. @odrcmn here it is Stationing polyline Also here Author website Stationing polyline
  8. @Clint Please give it a try (defun c:lay-nam-to-capital (/ (ACAD-OBJ ADOC LAY-COLL)) (VL-LOAD-COM) (SETQ ACAD-OBJ (VLAX-GET-ACAD-OBJECT)) (SETQ ADOC (VLA-GET-ACTIVEDOCUMENT ACAD-OBJ)) (SETQ LAY-COLL (VLA-GET-LAYERS ADOC)) (vlax-for lay lay-coll (vla-put-name lay (strcase (vla-get-name lay))) ) ;_ end of vlax-for ) ;_ end of defun
  9. Yesterday
  10. Danielm103

    Python Batch change layer name case

    The PIP is here ‘pip install cad-pyrx’ https://pypi.org/project/cad-pyrx/, the project is here https://github.com/CEXT-Dan/PyRx It’s an amalgamation of BRX and ActiveX APIs. There’s some stuff for BIM as well.
  11. Clint

    Python Batch change layer name case

    I will investigate this excellent suggestion further! I have Python installed and am learning it now. Best regards, Clint Hill
  12. BricsCAD V26 can run PyRx Python, makes Batch processing a bit easier sometimes. If you’re interested
  13. Python, makes Batch processing a bit easier sometimes import traceback from pyrx import Ap, Db def capcaseLayers(db: Db.Database): lt = Db.LayerTable(db.layerTableId()) for name, id in lt.toDict().items(): l = Db.LayerTableRecord(id, Db.OpenMode.kForWrite) l.setName(name.upper()) def processDb(fpath: str): sdb = Db.Database(False, True) sdb.readDwgFile(fpath) sdb.closeInput(True) capcaseLayers(sdb) sdb.saveAs(fpath) #add new command @Ap.Command() def caplayers(): try: for fpath in Ap.Application.listFilesInPath("E:\\temp", ".dwg"): processDb(fpath) except Exception as err: traceback.print_exception(err)
  14. Hi BIGAL, I appreciate your script lines example. Thankfully as part of the customization project, our developer created a BricsCAD-based batch scripting application that allows user selection of multiple files. So, I would simply save the script file to include the following lines: (load "updatelisp") (c:updatelisp) Best regards, Clint Hill
  15. I added the RLX change, I'll check it out when I get back to work.
  16. If using a script and running it over multiple dwgs then yes can load a lisp and then run it. The lisp can be very extensive a few lines or even hundreds. Open dwg1 (load "updatelisp") (c:updatelisp) close Y Open dwg2 (load "updatelisp") (c:updatelisp) close Y Open dwg3 (load "updatelisp") (c:updatelisp) close Y
  17. Last week
  18. While its good coding practice to have basic individual functions so you can see where errors show up or reuse code else where in a later project without having to Frankenstein parts from other longer code. This is simple enough to do all in one function. your notes and ques talk about explode but if their wasn't an error would be deleting. (defun C:QU (/ P SS) (vl-load-com) (setq P (getvar 'PICKSTYLE)) (vla-startundomark (setq Doc (vla-get-activedocument (vlax-get-acad-object)))) (setvar 'PICKSTYLE 1) (princ "\nSelect Entities to Delete: ") (if (setq SS (ssget)) (foreach obj (mapcar 'vlax-ename->vla-Object (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS)))) (vla-delete obj) ) (princ "\n Nothing Selected") ) (setvar 'PICKSTYLE P) (vla-Regen Doc acAllViewports) (princ) )
  19. I appreciate and will insert your code and will try it, rlx!
  20. untested ;;; (setq g-name (get_groupname (car (entsel)))) (defun GET_GROUPNAME ( ent / d gl o id lst) (setq d (vla-get-activedocument (vlax-get-acad-object)) gl (vla-get-groups d)) (setq o (vlax-ename->vla-object ent) id (vla-get-ObjectID o)) (vlax-for g gl (vlax-for e g (if (equal (vla-get-ObjectID e) id) (setq lst (cons (vla-get-Name g) lst)))(vlax-release-object e))(vlax-release-object g)) (if (vl-consp lst)(car lst)) )
  21. Hi Steven, This is good to know. I will check out BigAL's related post very soon. Your responses are reassuring and well received! My task is to hash out a program that reads from two lists and updates layer names to match the old version to both the current name (UPPERCASE). Thanks, Clint Hill
  22. Obviously we don't have your batch LISP - I guess your company paid for this and so you are not going to be popular sharing that for all online. LISPs can be added to scripts - both as a command and as code. There are others out there such as ScriptPro and Lee Macs Script Writer which will do this. BigAl will often post snippets of scripts here to batch process files - last one he did was in the last week or so ago. You could even set this up as a stand alone script to do just the one task (see BigAls last example....) The first step for all is to get a LISP working as you want and well on a single file and then to do it as a batch (first time running the batch with a new LISP, perhaps check carefully that it doesn't do anything unexpected on other files). Plenty of examples out there to change layer names from one to another - have a look to see if you see one you like to use, or if there isn't am sure we can put one together - and use what is above as a started if you want to have a go, I think all the code you need is in the examples, just need to think how to change them to your needs
  23. I obtained the attached program from another. In initial running of this program ONLY, I am experiencing the subject line error. (I run this in BricsCAD V25 & V26) The program continues to run and produces the desired results. IMPORTANT In later runs, it does not appear. BACKGROUND I attempted to debug in the BricsCAD BLADE programming environment (similar to AutoCAD's VLIDE) but have limited experience so far. QUESTIONS What is causing the following error? How do I correct it? -------- COMMAND ERROR MESSAGE ------- Select groups to be exploded: Select entities: Entities in set: 9 Select entities: ; error : Automation Error. Property [NAME] not available ------ Best regards, Clint Hill quickungroup.lsp
  24. Gentlemen, I think it best to explore the following pursuit "B" in a new post.
  25. maybe its just a matter of name vs effective block name issue , haven't tested that. But I like the routine and maybe gonna extend it a little with above suggestions if I run into a project that could benefit from this. Did find a program , I think it's called able2extact or something , that also has OCR built in but it will set you back around two hundred dollars , lifte time subscription.
  26. I only used it twice and it worked fine on those, latest one was 8 sheets, the first time was a while back not sure how many sheets. IIRC, it may only work on AutoCAD 2024 or newer in this version. Tested on AutoCAD 2026. I did this several months ago and just needed it again yesterday. So @rlx's addition may be needed for older. @BIGAL I thought about do a count, but I don't need it. I'll try to find time to research BricsCAD use. I was working on creating a Layout tab for each sheet, I might get back to it later, busy with paid work right now. Only other update I plan is maybe get more than one PDF, but that will much further down the line.
  27. Mine are 'plotPDF' for full size and then plotPDFA3, plotPDFA4 - no further actions needed - same as BigAL and RLX suggest
  28. ++
  29. Like @rlx this is a hard coded plot pdf using preset values, our dwg's used layouts one title block. the code is hard coded for a A1 sheet plotted as a A3 size. We just walked through the layouts and plotted. So does not matter what current plot settings are as they are ignored. We had multiple devices PDF, A1, A3 Color, A3 B-W. So code for each. (setvar "textfill" 1) (setvar "fillmode" 1) (COMMAND "-PLOT" "Y" "" "Plot To PDF" "Iso full bleed A3 (420.00 x 297.00 MM)" "m" "LANDSCAPE" "N" "W" "-6,-6" "807,560" "1=2" "C" "y" "Acad.ctb" "Y" "n" "n" "n" pdfName "N" "y" )
  1. Load more activity
×
×
  • Create New...