Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/01/2022 in all areas

  1. Batch Find & Replace Text This program uses ObjectDBX to perform multiple text replacements on the current drawing or a complete directory (and subdirectories) of drawings. The program has the ability to search Text, MText, Block Attributes, Multileader Text, Table Cell Text and Dimension Override Text. The user may replace multiple search strings, and load & save lists of search strings for future use, saving time in program data entry. Users may perform a complete Find & Replace operation, or merely search for potential replacements using the 'Search Only' option. Following a search operation, a report is displayed informing the user of the replacements which would be performed should the user proceed with the replacement. The report also displays the object containing the text to be replaced, along with the entity handle of such object, and the drawing filename in which the object resides. The program provides the user additional refinement options, as displayed in the Options Dialog. This enables the user to control which objects are searched, whether locked layers are included in the replacement, search item case-sensitivity and whether the search item must appear as a complete word to be replaced. The generation of a report following a text replacement may also be controlled within the Options Dialog (the report will always be created following a search operation). Help and examples can be found in the Code Header: Dialog Preview: Options Dialog: Function Syntax: BFind ;;-------------------------=={ Batch Find & Replace }==------------------------;; ;; ;; ;; Will Find and Replace multiple strings entered by the user within Text, ;; ;; MText, Block Attributes, MLeader Text, Table Text and Dimensions within the ;; ;; current drawing, all currently open drawings and/or a directory ;; ;; (and subdirectories) of drawings. ;; ;; ;; ;; If the 'Block Definitions' option is selected, all instances of the ;; ;; aforementioned text objects residing within block definitions are included ;; ;; in the search domain. ;; ;; ;; ;; Furthermore the user may choose which objects to search, whether the find ;; ;; string is case sensitive, and whether to restrict the search to whole words ;; ;; only. ;; ;;-------------------------------------------------------------------------------;; ;; ;; ;; FUNCTION SYNTAX: BFind ;; ;; ;; ;; Notes: ;; ;; --------- ;; ;; As expected, the known bug with ObjectDBX arises with regards to attribute ;; ;; alignment following modification. A sub-function has been included in an ;; ;; attempt to correct the change in position, however, a slight shift in ;; ;; position may be noticed. The attribute is realigned when the block is moved ;; ;; manually. ;; ;; ;; ;; Also, when using the Batch Find and Replace, drawing thumbnails are lost ;; ;; upon saving with ObjectDBX. These return when the drawing is saved manually. ;; ;; ;; ;;-------------------------------------------------------------------------------;; ;; ;; ;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;; ;; ;; ;;-------------------------------------------------------------------------------;; ;; ;; ;; With additional thanks to Joe Burke for his tremendous help towards using ;; ;; Regular Expressions to eliminate the problem of MText formatting codes when ;; ;; performing replacements. ;; ;; ;; ;;-------------------------------------------------------------------------------;; ;; Version: ;; ;; ;; ;; 1.0: 24/05/2010 - First Release ;; ;;-------------------------------------------------------------------------------;; ;; 1.1: 26/05/2010 - Added Options Button. ;; ;; - Updated String Replacement functions to allow for case ;; ;; sensitivity options. ;; ;; - Upgraded StringRep function to allow replacement string ;; ;; to contain find string. ;; ;; - Fixed bug causing an unsaved drawing to be saved. ;; ;;-------------------------------------------------------------------------------;; ;; 1.2: 29/05/2010 - Added ability to perform multiple replacements. ;; ;;-------------------------------------------------------------------------------;; ;; 1.3: 31/05/2010 - Added ability to edit find and replace entry by ;; ;; double-clicking. ;; ;; - Added 'Table Text' object to Options Dialog. ;; ;; - Added 'Find Whole Words Only' option to Options Dialog. ;; ;; - Redesigned Options Dialog to accommodate new toggles, ;; ;; added mnemonics. ;; ;;-------------------------------------------------------------------------------;; ;; 1.4: 27/04/2010 - Replaced 'StringRep' function with functions utilising ;; ;; Regular Expressions to allow for MText formatting. ;; ;;-------------------------------------------------------------------------------;; ;; 1.5: 29/09/2010 - Reformatted code. ;; ;; - Drawings only saved if a replacement is made. ;; ;;-------------------------------------------------------------------------------;; ;; 1.6: 03/10/2010 - Added pick buttons to select text for Find/Replace ;; ;; strings. ;; ;; - Added 'Match Case' option ;; ;; - Added 'Find Whole Words Only' option ;; ;;-------------------------------------------------------------------------------;; ;; 1.7: 05/10/2010 - Added 'Search Only' option in which the program will ;; ;; search for multiple strings within the current drawing ;; ;; and/or a directory (and subdirectories) of drawings, ;; ;; subsequently producing a report detailing the number ;; ;; of occurrences of each string and list of possible ;; ;; changes should a replacement be performed. ;; ;; - Added error trap to drawing processing loop to prevent ;; ;; crash should one drawing error. ;; ;; - Added delay to DCL creation. ;; ;;-------------------------------------------------------------------------------;; ;; 1.8: 08/10/2010 - Added Load & Save buttons to allow a set of search ;; ;; items to be loaded and saved. ;; ;;-------------------------------------------------------------------------------;; ;; 1.9: 09/10/2010 - Fixed bug involving capital 'S' being removed from ;; ;; textstring during stacking formatting code removal. ;; ;; - Added code to allow 'special' characters to be used in ;; ;; Find string. ;; ;;-------------------------------------------------------------------------------;; ;; 2.0: 22/07/2011 - Majority of program rewritten and reformatted to ;; ;; include the following enhancements: ;; ;; - Fixed tab stops in dialog to allow the user to use the ;; ;; tab key to navigate between edit boxes. ;; ;; - Added 'Where to Search' panel to allow the user to ;; ;; restrict the search to Modelspace, Layout space or Both.;; ;; - Added 'Block Definitions' to list of objects to search ;; ;; to allow users to search text objects in blocks. ;; ;; - Added 'Current Directory' toggle to allow the user to ;; ;; quickly select the current working directory to be ;; ;; processed. ;; ;; - Added ability to add items to find/replace list by ;; ;; pressing Enter from within either edit box. ;; ;; - Added ability to press Enter after entering Save ;; ;; Reference without needing to click the OK button. ;; ;; - Added ability to press Enter after editing entry ;; ;; without needing to click the OK button. ;; ;; - Changed format of Saved Searches file for easier ;; ;; manual editing. ;; ;; - Added ability to process 'All Open Drawings'. ;; ;;-------------------------------------------------------------------------------;; A full description can be found here. Disclaimer: BFind.lsp is not entirely bug-free, as demonstrated by the information contained herein: I would hence advise against its usage in cases where heavily formatted MText is involved. However, it should, in most cases, perform successfully. When replacements are made, drawings will be saved in native format (i.e. if run in AutoCAD2010, will be saved as 2010 drawing). BFindV2-0.lsp
    1 point
  2. Sort of like tombu we always had fixed size title blocks and used viewports for scaling, so plotting always worked and we never used FIT rather true scales like 1=1 and 1=2. So think about using a title block even just a fixed size rectang and we used window select lower left, upper right and center. Lastly we use a plot lisp so don't read the page setup, plotted up to 88 layouts in one button press. There are plenty of lisp examples out there, just google, Maratovich has a very good one.
    1 point
  3. That was my bad .. I meant: (vlax-curve-getStartPoint (entlast))
    1 point
  4. That doesnt seem to work in BricsCAD. (vlax-get (vlax-ename->vla-object (entlast)) 'startpoint)
    1 point
  5. @mhupp FWIW ;; This (vlax-safearray->list (variant-value (vla-get-startpoint (entlast)))) ;; is the same as this (vlax-curve-getStartPoint (entlast))
    1 point
  6. Spitballing here. make first arc get its endpoints S1P1 (vlax-safearray->list (variant-value (vla-get-startpoint (entlast)))) S2P1 (vlax-safearray->list (variant-value (vla-get-endpoint (entlast)))) make second arc get its endpoints S1P2 (vlax-safearray->list (variant-value (vla-get-startpoint (entlast)))) S2P2 (vlax-safearray->list (variant-value (vla-get-endpoint (entlast)))) Either update lines with new endpoints or erase them and draw new ones. line1 s1p1 s1p2 line2 s2p1 s2p2
    1 point
  7. The what's new says they've added productivity to 2023. 'bout time. That's somethin' I could never do.
    1 point
×
×
  • Create New...