Leaderboard
Popular Content
Showing content with the highest reputation since 06/27/2026 in Posts
-
Here's a simple Lisp routine for obtaining data from an integrated GNSS receiver. It works by sending a small script to PowerShell, which writes the data to a file named 'pos.txt' saved in the Documents folder. I've only tested it on a single device, but it should work on any device equipped with an integrated GNSS receiver. The data is stored in latitude/longitude format, so each user will need to transform those coordinates into the desired coordinate reference system. To stop logging the data, simply close the PowerShell window This is just a starting point for anyone who wants to adapt it to their own needs. ;************************ G L A V C V S ************************* ;************************** F E C I T *************************** ;;;THIS CODE STARTS GNSS RECEIVER AND WRITES DATA TO A FILE CALLED 'pos.txt' IN THE My Docments FOLDER (defun startGNSS (/ cmd sh dir cad ur) (setq dir (VL-REGISTRY-READ "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" "Personal" ) ) (if (setq sh (vlax-create-object "WScript.Shell")) (progn (if (and (or (setq ur (getint "\nUpdate rate (milliseconds) <1000>/2000/3000/5000 : ")) (not ur)) (member ur '(nil 1000 2000 3000 5000))) (progn (setq cad (strcat "Add-Type -AssemblyName System.Device" (chr 13) (chr 10) "# 1) Conectar con AutoCAD abierto" (chr 13) (chr 10) "$outFile = \'" dir "\\pos.txt\'" (chr 13) (chr 10) "try {" (chr 13) (chr 10) " $acad = [Runtime.InteropServices.Marshal]::GetActiveObject(\'AutoCAD.Application." (itoa (atoi (getvar "ACADVER"))) "\')" (chr 13) (chr 10) "}" (chr 13) (chr 10) "catch {" (chr 13) (chr 10) " Add-Type -AssemblyName System.Windows.Forms" (chr 13) (chr 10) " [System.Windows.Forms.MessageBox]::Show(" (chr 13) (chr 10) " \'Por alguna razón no se pudo conectar con AutoCAD mediante COM.\' + [Environment]::NewLine + $_.Exception.Message," (chr 13) (chr 10) " \'GNSS-}AutoCAD: Error de conexión\'," (chr 13) (chr 10) " [System.Windows.Forms.MessageBoxButtons]::OK," (chr 13) (chr 10) " [System.Windows.Forms.MessageBoxIcon]::Error" (chr 13) (chr 10) " )" (chr 13) (chr 10) " exit" (chr 13) (chr 10) "}" (chr 13) (chr 10) "# 2) Crear y arrancar receptor de ubicación Windows/GNSS" (chr 13) (chr 10) "$w = New-Object System.Device.Location.GeoCoordinateWatcher" (chr 13) (chr 10) "$w.Start()" (chr 13) (chr 10) "# 3) Bucle continuo: comprobar estado, obtener posición y escribir en USERS5" (chr 13) (chr 10) "while ($true) {" (chr 13) (chr 10) " $doc = $acad.ActiveDocument" (chr 13) (chr 10) " $status = $w.Status" (chr 13) (chr 10) " $p = $w.Position.Location" (chr 13) (chr 10) " $time = Get-Date -Format \'dd-MM-yyyy HH:mm:ss\'" (chr 13) (chr 10) " if ($status -eq \'Disabled\') {" (chr 13) (chr 10) " $line = \'*** GNSS ERROR: GNSS disabled ***\';;;;;;\"" (chr 13) (chr 10) " }" (chr 13) (chr 10) " elseif ($status -eq \'Initializing\') {" (chr 13) (chr 10) " $line = \'*** GNSS ERROR: Searching... ***\';;;;;;\"" (chr 13) (chr 10) " }" (chr 13) (chr 10) " elseif ($status -eq \'NoData\') {" (chr 13) (chr 10) " $line = \'*** GNSS ERROR: Without data ***\';;;;;;\"" (chr 13) (chr 10) " }" (chr 13) (chr 10) " elseif ($p.IsUnknown) {" (chr 13) (chr 10) " $line = \'*** ERROR GNSS: Unknown position ***\';;;;;;\"" (chr 13) (chr 10) " }" " else {" (chr 13) (chr 10) " $line = $p.Latitude + ';' + $p.Longitude + ';' + $p.Altitude + ';' + $p.HorizontalAccuracy + ';' + $p.VerticalAccuracy" (chr 13) (chr 10) " }" (chr 13) (chr 10) " try {" (chr 13) (chr 10) " Set-Content -Path $outFile -Value $line" (chr 13) (chr 10) " }" (chr 13) (chr 10) ;;; " catch {" ;;; (chr 13) ;;; (chr 10) ;;; " Write-Host 'ERROR escribiendo...: $($_.Exception.Message)'" ;;; (chr 13) ;;; (chr 10) ;;; " }" (chr 13) (chr 10) (strcat " Start-Sleep -Milliseconds " (if ur (itoa ur) "1000")) (chr 13) (chr 10) "}" ) cmd (strcat "powershell.exe -NoProfile -ExecutionPolicy Bypass -NoExit -Command \"" cad "\"" ) ) (vlax-invoke-method sh 'Run cmd 1 :vlax-false) (grtext -1 "*** GNSS writing file \'pos.txt\' ***") ) (alert "ERROR: \nUpdate rate should be 1000, 2000, 3000 or 5000\n\nExiting...") ) (vlax-release-object sh) ) ) )4 points
-
The lat long convert is out there I have used one for here in AUS, the formula behind it is the same I think for any where in the world, but inside it is numerous values that depend on your location in the world, something like 8. values can be like 0.9987999 scale factor. So we need @PGia to tell us where she/he is in the world and what zones are relevant. Will do a quick look for the formula.3 points
-
Thanks, @BIGAL You're right: it's probably necessary to solve the problem of transforming latitude/longitude to UTM. I might review the code to publish a more complete version. Or maybe someone else will do it before me3 points
-
@tombu Ive had contact with AutoDesk: Hello Michel, I am writing to confirm that I have reviewed the issue you reported and replicated the results you described (see this video:https://go.screenpal.com/watch/cOieX2nU2gH ). I want to assure you that we've reported it to our development team, and they're currently investigating it. The resulting internal development ticket is linked to this technical support case and has the following Issue ID/subject: "CPR-2262 Reloading complex linetype without SHX shape does not update line display". AutoCAD confirmed that this issue is present since AutoCAD 2025 version.2 points
-
@masao_8 The Express tools must be installed with AutoCAD. If you mean just loading it, it's in my code above: (if acet-load-expresstools (acet-load-expresstools)) To make a grread loop work exactly like ssget. it's a huge ask. There is a ton of options to emulate. Could you explain EXACTLY what you want the function to do? What you're asking for has seemed to shift, or you weren't explaining it well enough. Below is an update to my code to add just the auto window and crossing selection: ;; Function to do a simple Select/Deselect using grread. ;; By PJK - 6/16/2026 ;; Updated 6/29/2026 to add window selection emulation (defun pjk-grread-Select (/ done en grl grc grv ss ss->elst sx wp1 wp2) (defun ss->elst (ss / i r) (if ss (repeat (setq i (sslength ss))(setq r (cons (ssname ss (setq i (1- i))) r))) ) ) (if acet-load-expresstools (acet-load-expresstools)) (setq ss (ssadd)) (princ "\nSelect to add objects or SHIFT+Select to remove from selection set: ") (while (not done) (setq grl (grread T 15 (if wp1 0 2)) grc (car grl) grv (cadr grl) ) (cond ((= grc 5) (redraw) (if wp1 (progn (grdraw wp1 (list (car grv) (cadr wp1) (caddr wp1)) -1 (if (< (car grv) (car wp1)) 1 0)) (grdraw wp1 (list (car wp1) (cadr grv) (caddr wp1)) -1 (if (< (car grv) (car wp1)) 1 0)) ) ) ) ((= grc 3) (if (acet-sys-shift-down) (if (setq en (car (nentselp grv))) (progn (if (ssmemb en ss)(ssdel en ss)) (redraw en 4) ) (if (not wp1) (progn (setq wp1 grv) (princ "\rSelect opp corner: ") ) (progn (redraw) (setq wp2 grv) (if (< (car wp2) (car wp1)) (mapcar '(lambda (a)(ssdel a ss)(redraw a 4)) (setq sx (ss->elst (ssget "C" wp1 wp2))) ) (mapcar '(lambda (a)(ssdel a ss)(redraw a 4)) (setq sx (ss->elst (ssget "W" wp1 wp2))) ) ) (princ (strcat "\n(" (itoa (length sx) ) ") Objects found and Removed from selection. " ) ) (setq wp1 nil wp2 nil) ) ) ) (if (setq en (car (nentselp grv))) (progn (ssadd en ss) (redraw en 3) ) (if (not wp1) (progn (setq wp1 grv) (princ "\rSelect opp corner: ") ) (progn (redraw) (setq wp2 grv) (if (< (car wp2) (car wp1)) (mapcar '(lambda (a)(ssadd a ss)(redraw a 3)) (setq sx (ss->elst (ssget "C" wp1 wp2))) ) (mapcar '(lambda (a)(ssadd a ss)(redraw a 3)) (setq sx (ss->elst (ssget "W" wp1 wp2))) ) ) (princ (strcat "\n(" (itoa (length sx)) ") Objects found and added to selection. " ) ) (setq wp1 nil wp2 nil) ) ) ) ) ) ((= grc 2) (setq done (if (vl-position kcode '(13 32)) T nil)) ) ((= grc 25)(setq done T)) ) ) (if (> (sslength ss) 0) (progn (foreach i (mapcar 'cadr (ssnamex ss))(redraw i 4)) ss ) nil ) )2 points
-
What are you trying to accomplish with this code? First and foremost vla-CopyObjects doesn't support Layouts in the manner you are attempting, AFAIK. You need to use -LAYOUT command or pretty much need to use LeeMac's Steal or at least determine the method he uses for Layouts, which if I am looking at it correctly uses the Block Table record maybe more as I quickly glanced at it.2 points
-
Did the reload shx work ? It may take some time for a bug fix.1 point
-
Hello, I'm back here once again to bring up a very interesting topic: How can AutoCAD (installed on a Windows 10 tablet with an integrated GNSS receiver) be made to display its real-time UTM position (or latitude/longitude), for example through a block? Is this possible? Are there any Lisp routines capable of achieving this?1 point
-
Yep found the formula, also found some Excel convert formula. Did find even a lisp link. Try this in google. formula for convert latitude and longitude to northing and easting using lisp1 point
-
Have you tried saving, closing and reopening the drawing? I retired a few years ago and never saw the latest version. Here's a link to a lisp that will output the linetype definition of a selected line to the command line. I wrote it to extract linetypes I liked from drawings by others to add to my acad.lin file: https://forums.autodesk.com/t5/autocad-forum/export-linetype-to-acad-lin/m-p/11945136#M36909 which is why I called it LT_thief.lsp It will output the actual current linetype definition of a selected line to the command line including the shape references.1 point
-
Thanks for your interest. @BIGAL: To transform coordinates from LL to UTM, you only need to know the UTM zone, the hemisphere (N/S), and the datum (WGS84, ETRS89, Hayford, Clarke, etc.). The central meridian scale factor in the UTM system is always 0.9996. I usually work within UTM zones 31N, 32N, and 33N. However, the code should be able to return UTM coordinates for any location simply by specifying the UTM zone, hemisphere, and datum as parameters1 point
-
Hi All, thanks for the replies. @tombu That is exactly the issue. I removed the SHAPE reference from the linetype, reload the linetype. I see that the linetype is changed a bit, but the SHAPE keeps being shown. Even when i check the linetype definition in the DWG, the SHPAE reference is gone there, but still visualy there. Look, there are my definitions: Video attatched with my relaoding action. when i load the WITHOUT.LIN in a NEW drawing. the linetype is just fine... In the last sec off the video i do a REA command, and you see the linetype presentation change a bit. Most anoying... in AutoCAD 2023 this works just fine... looks like an AutoCAD 2027 error. Sample.mp41 point
-
Did you regen the drawing? Shapes are referenced by linetypes not defined by them. Whatever Shapes defined in the drawing would still be there. Did you remove the Shape references in the linetype definition before reloading it?1 point
-
I don't have AutoCAD 2027, but it may show up in AutoCAD 2026. I will do some checking when I get back to work next week. You should post your script and your shape linetypes that are an issue. You could see if a LISP works for you Lee Mac has one... https://lee-mac.com/loadlinetype.html. Here is an example of using loadlinetype.lsp in a Macro... You may want to contact Autodesk, they may know about the issue or at least would need to know.1 point
-
import traceback from pyrx import Ap, Db, Ed, Ge def validate_layout(source_db: Db.Database, target_db: Db.Database, layout_name: str): """Validates if the layout exists in source and is safe to write to target.""" source_layout_dict = Db.Dictionary(source_db.layoutDictionaryId()) if not source_layout_dict.has(layout_name): print(f"Layout '{layout_name}' not found in source drawing.") return False target_layout_dict = Db.Dictionary(target_db.layoutDictionaryId()) if target_layout_dict.has(layout_name): print(f"Layout '{layout_name}' already exists in target drawing.") return False return True def clone_layout_from_db(source_db: Db.Database, target_db: Db.Database, layout_name: str): """Clones a specified layout from a source database to a target database layout dictionary.""" if not validate_layout(source_db, target_db, layout_name): return False try: source_layout_dict = Db.Dictionary(source_db.layoutDictionaryId()) source_layout_id = source_layout_dict.getAt(layout_name) id_map = Db.IdMapping() id_map.setDestDb(target_db) source_db.wblockCloneObjects( [source_layout_id], target_db.layoutDictionaryId(), id_map, Db.DuplicateRecordCloning.kDrcIgnore, ) return True except Exception as e: print(f"Error encountered during cloning: {e}") traceback.print_exc() return False @Ap.Command() def doit(): layout_name = "S7" source_path = r"E:\Batch\06457 RE Submittal.dwg" target_db = Db.curDb() try: source_db = Db.Database.createFromDWG(source_path) if clone_layout_from_db(source_db, target_db, layout_name): print(f"Successfully cloned layout '{layout_name}'.") manager = Ap.LayoutManager() manager.updateLayoutTabs() except Exception as err: print(f"Failed to load or process source drawing: {err}")1 point
-
@GLAVCVS nicely done, yes need a convert lat long to XY, if you have CIV3D then yes can read lat long directly.1 point
-
Given that you indicate pre 2000 it is maybe time to upgrade. There is alternatives to Acad like Bricscad, Intellicad, Gstar to mention a few and much cheaper.1 point
-
@masao_8 Before i try this code, could you please explain what is does and/or provide a sample drawing to test it on? It would save me time trying to determine what you are doing. You didn't put any comments in your code explaining it. EDIT: So I tried your code and it seems to work OK for me. It appears that it adds text for circles with the dia. and copies properties from the base circle? I kind of understand what you are going for; to be able to change option (Text height) during selection. I don't have AutoCAD 2012 or AutoCAD 2016 to test what your issue is, but I think you will have to research how express tools have changed since those versions, and if the loading is different? TIP: during your window selection, you could add the filter for CIRCLES (it's already in your "_getwindowselection" function), then you wouldn't need to pick them out while processing the selection set.1 point
-
Post the extracted data we can not help unless we have something we can touch. The correct way to approach this is to match the borehole label with its corresponding attribute data. I did this for a client and we are talking hundreds of objects like your boreholes, so have something maybe already done. The simplest way is make the tables from the data.1 point
-
There is more people using Bricscad these days and designing roads, surfaces drainage and sewerage is much in demand. If Admin is happy this is a link to Civil Site Design demonstration running under Bricscad. Any one who has used CIV3D or some other CIvil software may be interested. Its features are well in advance of the current inbuilt Civil features in Bricscad. https://bricsys.registration.goldcast.io/events/6416ee0a-cbec-4869-a7fa-60922b0a5905?utm_campaign=45980519-APACWebinar-NextGenCSD-26Q3-APAC&utm_source=email&utm_medium=CADapps_email&utm_content=NextGenCSD_invite1 point
-
I don't know if I understood exactly what the need was, but here is my proposal. Moving the cursor over entities adds to the selection if the mode is active (left-click) and pressing + or - toggles to add or remove. (defun C:AutoSel ( / oldpcka key_mod ss tmp key_sel e_sel) (setq oldpcka (getvar "PICKADD") key_mod 'ssadd) (setvar "PICKADD" 2) (or (setq ss (ssget "_I")) (setq ss (ssget "_P")) ) (if ss (sssetfirst nil ss) (setq ss (ssadd))) (princ "\n[+/-]: AutoSelect ADD/REMOVE [Left-Click]: AutoSelect ON/OFF [Right-Click]: Quit AutoSelect ") (princ "\nAutoSelect <<OFF>>") (while (or (= 5 (car (setq tmp (grread t 5 2)))) (= 3 (car tmp)) (member tmp '((2 43) (2 45)))) (cond ((= 2 (car tmp)) (cond ((eq (cadr tmp) 43) (setq key_mod 'ssadd) (princ "\nMode add select") ) ((eq (cadr tmp) 45) (setq key_mod 'ssdel) (princ "\nMode remove select") ) ) ) ((= 3 (car tmp)) (if (null key_sel) (progn (setq key_sel T) (princ "\nAutoSelect <<ON>>") ) (progn (setq key_sel nil) (princ "\nAutoSelect <<OFF>>") ) ) ) ((= 5 (car tmp)) (cond ((and key_sel (setq e_sel (nentselp (cadr tmp)))) (cond ((eq 'ENAME (type (car (last e_sel)))) ((eval key_mod) (car (last e_sel)) ss) ) ((eq "VERTEX" (cdr (assoc 0 (entget (car e_sel))))) ((eval key_mod) (cdr (assoc 330 (entget (car e_sel)))) ss) ) (T ((eval key_mod) (car e_sel) ss)) ) (sssetfirst nil ss) ) (T nil) ) ) (T (princ "\nAbnormal command shutdown ")) ) ) (setvar "PICKADD" oldpcka) (princ "\nEnd of command. ") (prin1) )1 point
-
I have merged the 2 threads since they seem related.1 point
-
I think what you're saying makes a lot of sense, @Steven P I often identify locations in an AutoCAD drawing where there are questionable features that I need to verify on site. The idea is to use AutoCAD itself to navigate to each location, edit the drawing, and capture additional points if necessary, without having to export and import data through intermediate applications. I suppose this is something that many people have had in mind for quite some time.1 point
-
Admin may want to merge the two posts about this task, questions asked on other post, information is missing that is needed to provide a solution. Where is table data source ?1 point
-
Need some more clarification, you ask for multi line to be different colors, but you have table that are multi row, not Multi line cells. That is a big difference. So if you just want tables with a heading and one row to be red, then any others with header and rows greater than 2 will be heading Red line rest green 87 lines. That can be done. I think need to go back a step and work on the table creation in your other post as you pick boreholes there is no reason why the colors can not be set then. So will have a go at the other post, making single table for multiple boreholes much easier than trying to place individual tables for each borehole. Will post something for you to say yes that is ok. I did ask about the source data where is the say Excel or csv that has the values that are being used in your tables, you have supplied a half answer.1 point
-
Back to your code, using OBDX you get the layout list like this. ; example code by AlanH June 2026 (setq fname (getfiled "Select dwt File" "D:\\alan" "dwt" 16)) (setq impdoc (vla-getinterfaceobject (vlax-get-acad-object) (strcat "ObjectDBX.AxDbDocument." (itoa (atoi (getvar 'acadver)))) ) ) (vl-catch-all-apply 'vla-open (list impdoc impdwg)) (setq layout (vlax-get-property impdoc 'layouts)) (setq lst '()) (vlax-for lname layout (setq lst (cons (vlax-get lname 'name) lst)) ) (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (if (= but nil)(setq but 1)) (setq ans (ah:butts but "V" (cons "Please choose" lst))) (command "layout" "T" lname ans) You can then feed that lst to say a dcl and choose, this is using a library function that returns the layout name, save multi radio buttons in a support path or edit the (load to full path where saved. It will work for up to about 20 layout names, a screen limitation. Give it a try let me know how it works, Multi radio buttons.lsp1 point
-
As the cell is Mtext you can set each line a different color, using the mtext color control. This was done manually. So will see maybe later will have time to do something. Have an idea will find the cells with multi line split into multi text lines, display the line and what color it is now so you can change any or all lines. Looking at dwg it looks like you only want 2 colors 1 & 87 so will keep the multi color for later.1 point
-
I wouldn't be too concerned about taking up AutoCAD processing, if you are out surveying then you probably aren't drawing? I'd do the LISP on demand though, say 'c:GNSS' whenever you want to plot the point, if you are wanting to use CAD while surveying - that way you are grabbing the point at the location you are at. LISP would probably work best by: Copy data file to say temp folder, read copied file, close copied file to avoid conflicts... so long as the receiver saves the data regularly and not just on closing the application. Might be the better option - can add in a DCL pop up to add data about the point recorded (what it is, and so on)1 point
-
Perhaps it's easier than it seems. If it is an integrated receiver and Windows is able to obtain location data from it, then you should be able to access that data through the 'Windows Location API'. In that case, it should be possible to write a script to be executed from PowerShell that creates a loop to poll the receiver and write the data to a file. That loop would run in parallel with AutoCAD, allowing Lisp to read the new data as it is written. This method would be "intrusive", since it would occupy AutoCAD's command stream for as long as the command is running. However, there is another, less intrusive option that could operate in the "background": write the data to a system variable ('USERS#') and create a reactor that responds to changes in that variable: 'vlr-sysvar-reactor'. If the script is executed in a background PowerShell instance, you would also need to write a Lisp command capable of closing that instance when necessary. Once the script has been debugged, it could be incorporated into the Lisp code itself, making the whole solution completely self-contained. I haven't had much free time lately, but I'll try to investigate all of this a bit further.1 point
-
@masao_8 Here is a solution for a simple single selection add and SHIFT-Select to remove. Perhaps this will give you a basis for starting: ;; Function to do a simple Select/Deselect using grread. ;; By PJK - 6/16/2026 (defun pjk-grread-Select (/ done en grl grc grv ss) (if acet-load-expresstools (acet-load-expresstools)) (setq ss (ssadd)) (princ "\nSelect to add objects or SHIFT+Select to remove from selection set: ") (while (not done) (setq grl (grread T 15 2) grc (car grl) grv (cadr grl) ) (cond ((= grc 3) (if (setq en (car (nentselp grv))) (if (acet-sys-shift-down) (progn (if (ssmemb en ss)(ssdel en ss)) (redraw en 4) ) (progn (ssadd en ss) (redraw en 3) ) ) ) ) ((= grc 2) (setq done (if (vl-position grv '(13 32)) T nil)) ) ((= grc 25)(setq done T)) ) ) (if (> (sslength ss) 0) (progn (foreach i (mapcar 'cadr (ssnamex ss))(redraw i 4)) ss ) nil ) )1 point
-
Perhaps you could use the undocumented (acet-sys-shift-down) express tools function within the grread loop? Then you would have to manipulate highlighting with (redraw [3/4]) and use (ssadd) and (ssdel) to update the selection set.1 point
-
Doesn't that depend on PICKADD value? I do believe the default is select to add and shift select to deselect from selection set. To that end, it needs to be clarified from OP what they need, my WAG is something being already done with grread and need to deselect. AFAIK (and that's very little, mostly from my previous thread ) The left click is doable with grread, but it would ignore the SHIFT (also CTRL, etc.), so probably would need something else to show the SHIFT key is pressed. Which reminds me I need to get back to work on that and the centerline on rivers, roads, etc. problem when I get regular work caught up.1 point
-
Isn't that how CAD works already? you select something either by mouse clicke or window it will be highlighted hold shift to deselect it the same way. I know if you have to many things selected they are no longer highlighted.1 point
-
I think you would need to test for 'shift' being pressed and the test for a left mouse entity selection. Do a 'princ' on your grread loop to display what you are doing, shift and select something - which should give you what you want to test for.1 point
-
I've now updated this program to support resetting components of the incrementing string back to a given value with a given frequency - the latest version can be downloaded from my site: https://lee-mac.com/numinc.html1 point
-
Yes but as I have had to do things working with the government or local municipalities isn't so cut and dry. just easier to do it the way they want it1 point
-
Adding a few example macros from my Linetypes drop-down added to the Properties ribbon tab of my custom cuix file. As most of us use visual lisp it's easier to add (vl-load-com) to acaddoc.lsp than adding it to every lisp or macro. Keeping all my lin files in the same support folder as acad.lin makes accessing them easier. Loading lin files using Lee Mac's code: Reload Current ^C^C^P(or LM:LoadLinetypes (load "LoadLinetypesV1-3.lsp"))(LM:LoadLinetypes (list(getvar "celtype")) T) Reload All ^C^C^P(or LM:LoadLinetypes (load "LoadLinetypesV1-3.lsp"))(LtRedef) Dots ^C^C^P(or NewStyle (load "NewStyle.lsp"))(NewStyle "Arial" "arial.ttf") (or LM:LoadLinetypes (load "LoadLinetypesV1-3.lsp"))(LM:LoadLinetypes '("ArialDOT" "ArialDOT2" "ArialDOTX2" "PlusPlus") T) LT Curves ^C^C^P(or LM:LoadLinetypes (load "LoadLinetypesV1-3.lsp"))(LM:LoadLinetypes '("C25" "C-25" "C50" "C-50" "TREELINE_L" "TREELINE_R") T) LT Fences Walls ^C^C^P(or LM:LoadLinetypes (load "LoadLinetypesV1-3.lsp"))(LM:LoadLinetypes '("FENCELINE1" "FENCELINE2" "FENCE" "FENCE2" "FENCE5" "RD-Fence" "FENCE-BOX" "FENCE-BOX2" "FENCE-BOX4" "FENCE-BOX8" "FENCE-DIA" "FENCE-DIA2" "FENCE-DIA4" "FENCE-HW" "FENCE-H1" "FENCE-H2" "FENCE-O" "FENCE-X" "FENCE-Alan" "FENCE-X2" "FENCE-X4" "FENCE-O2" "BARBWIRE_1" "BARBWIRE_2" "CHAINLINK_1" "CHAINLINK_2" "STOCKADE_1" "STOCKADE_2" "STONEWALL") T) LT Dir Arrows ^C^C^P(or NewStyle (load "NewStyle.lsp"))(NewStyle "Arial" "arial.ttf") (or LM:LoadLinetypes (load "LoadLinetypesV1-3.lsp"))(LM:LoadLinetypes '("DIRECTION" "DIRECTION2" "DIRECTION5" "DIRECTION-A" "ArialARROW" "ArialAHead" "ArialTriangle") T) LT Danger ^C^C^P(or NewStyle (load "NewStyle.lsp"))(NewStyle "WINGDINGS" "wingding.ttf") (or LM:LoadLinetypes (load "LoadLinetypesV1-3.lsp"))(LM:LoadLinetypes '("Danger") T) Creating linetypes with text with ronjonp's lisp at https://www.theswamp.org/index.php?topic=47058.msg520876#msg520876 Everyone should have this, Thanks ronjonp! ^C^C^P(or C:makelt (load "makelt.lsp"));makelt Editing lin files: Edit Acad.lin ^C^C_start;acad.lin; Edit Arial.lin ^C^C_start;Arial.lin; Edit BOUCLES.lin ^C^C_start;BOUCLES.lin; List all Shape Names from all loaded Shape files using ShapeNames.lsp by lido. Handy if you only have the shx file not the shp. ^C^C^P(if(not ShapeNames)(load "ShapeNames.lsp"))(ShapeNames);; Code I added to bottom of Lee's LoadLinetypesV1-3.lsp for reloading all linetypes: ;Reload All Loaded Linetypes (defun LtRedef ( / acadObj doc ltlay) (setq acadObj (vlax-get-acad-object) doc (vla-get-ActiveDocument acadObj) ) (vlax-for obj (vla-get-linetypes doc) (if (not (wcmatch (vla-get-name obj) "*|*,Continuous,ByBlock,ByLayer")) (setq ltlay (cons (vla-get-name obj) ltlay)) ) ) (LM:loadlinetypes ltlay T) (vla-Regen doc acActiveViewport) ) Required lin, shx, shp and lsp files attached, adding Arial, wingdings and wingdings3 text styles are done with attached NewStyle.lsp wingdings.lin wingdings3.lin Arial.lin boucles.lin acad.lin boucles.shp boucles.shx NewStyle.lsp1 point
-
1 point
-
There must be a search path hierarchy, thus Move up/down buttons, or maybe it has to find acad.lin first. I have fixed issues with custom stuff, hatches for instance, by using the move up/move down buttons on the files tab, nothing more.1 point
-
Hang on, "ltypeshp.shx" (or any shx for that matter) used as a source for shapes in AutoCAD linetypes are not Windows fonts. There is no "defined correctly" that needs to be done, anywhere, especially in the registry. Even custom linetypes that reference TEXT, are defined using a "textstyle" name, not a "font" name. @dal-designs, if you think your "ltypeshp.shx" file might be corrupt, find the original on the install media, or find "ltypeshp.shp" and run it through the COMPILE command in AutoCAD to create a fresh new one.1 point
-
Of course you do, because your addition of PROPLINE at the end of the file did not cause problems on line 119. The common factor in Fenceline (line 119), Fenceline2 (line 121), TRACKS (line 123), BATTING (line 125), ZIGZAG (line 137) is the shape file it references, which is ltypeshp.shx Paste this to the command line (findfile "ltypeshp.shx") What does it return? When you find this file, put the SHX file, the LIN file, and other custom, personal goodies in a new empty directory (for example "C:\CADSTUFF") - then add this path to the TOP of your support file search path (SFSP) - and you're done forever. When you upgrade or get a new machine, all you have to do is add the path to the SFSP.1 point
-
Yes, you can add a custom linetype to the acad.lin file and the world as you know it won't end. I already proved that. You just made a mistake somewhere along the way that's all. Now you have to fix it. Re: FINDFILE Type this at the command line EXACTLY as shown then press Enter..... (findfile"acad.lin") The path that is returned is the path to the source file AutoCAD is using. It may not necessarily be the file you edited.1 point
-
I simply would have put my new linetype (call it Propline.lin) in the same folder as the original acad.lin file was in and called it a day. Or create a new MyCustom.lin file and put all my custom lines in there never to be mixed in with the standard AutoCAD linetypes. Just curious. Did you ever run the FINDFILE command back before you mucked around in the folders to verify the correct path to acad.lin? I ran two tests. First I loaded your linetype separately, from my Desktop, in AutoCAD 2015 to check if it worked. It did. Then I edited the acad.lin file for AutoCAD 2014, started the program, loaded the linetype and it worked. Bottom line (no pun intended) you mucked things up. I'd restore the original acad.lin back where AutoCAD had it in the first place and test. If it works then make a copy (in the same folder) and edit the original acad.lin by adding your new linetype to the end of the file followed by at least one space then save. Start AutoCAD and test.1 point
