All Activity
- Past hour
-
NicoleCAD joined the community
- Today
-
Automatically placing borehole tables with leaders without overlap
BIGAL replied to MSHR's topic in AutoLISP, Visual LISP & DCL
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 ? -
Change text color in AutoCAD Lt Tables Lisp request
BIGAL replied to MSHR's topic in AutoLISP, Visual LISP & DCL
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. -
Copying layouts with vla-CopyObjects breaks drawing
BIGAL replied to buntobaggins's topic in AutoLISP, Visual LISP & DCL
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.lsp - Yesterday
-
Change text color in AutoCAD Lt Tables Lisp request
BIGAL replied to MSHR's topic in AutoLISP, Visual LISP & DCL
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. -
Really the concern is if system set/getenv can be used in a macro, and using it for visibility as with: ID_BouReg [$(if,$(and,$(getvar,hpbound),1),!.)Polyline BOundary ]$M=$(if,$(and,$(getvar,hpbound),1), setvar hpbound 0, setvar hpbound 1) regenall which is the switch (the $if..,!.) for poly/region of boundary which shows with a 'check when set to polyline.
-
AI suggestion not working - saved it to my menu ^C^C$M=$(if,$(==,$(getenv,ShowTabs),"0"),_setenv ShowTabs 1,_setenv ShowTabs 0) my acad replies: Command: setenv Unknown command "SETENV". Press F1 for help. Command: ShowTabs Unknown command "SHOWTABS". Press F1 for help. Command: 0 Unknown command "0". Press F1 for help.
-
ronjonp started following Copying layouts with vla-CopyObjects breaks drawing
-
Copying layouts with vla-CopyObjects breaks drawing
ronjonp replied to buntobaggins's topic in AutoLISP, Visual LISP & DCL
-
Standard texts are hiding somehow can anyone please help??
Vijay posted a topic in Student Project Questions
-
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)
-
Change text color in AutoCAD Lt Tables Lisp request
MSHR replied to MSHR's topic in AutoLISP, Visual LISP & DCL
I attached sample file. Sample.dwg -
Danielm103 started following GNSS on AutoCAD
-
Change text color in AutoCAD Lt Tables Lisp request
MSHR posted a topic in AutoLISP, Visual LISP & DCL
Hi Folks, I'm looking for an existing AutoLISP routine before writing one from scratch. I need a Lisp for AutoCAD Tables (AcDbTable) that can detect text inside a table cell that has been separated using Alt+Enter (multiple lines within the same cell). The desired workflow is: Select one or more AutoCAD Lt tables. Scan every cell. Detect cells containing multiple lines (Alt+Enter line breaks). Display the cell location (row and column). Show each individual line with its line number. Ask which line should be modified. Ask for an AutoCAD Color Index (ACI). Change the font color of only that specific line, while preserving all other formatting in the cell (font, text height, bold, italic, stacked text, fields, etc.). Example: Cell (Row 3, Column 5) Line 1: Existing Text Line 2: New Text Line 3: Notes Choose line to recolor: 2 ACI Color: 1 (Red) Only Line 2 should become red. Has anyone already written a Lisp that does something similar, or knows of an existing solution? Any links, examples, or source code would be greatly appreciated. -
Automatically placing borehole tables with leaders without overlap
MSHR replied to MSHR's topic in AutoLISP, Visual LISP & DCL
No its mine, So sorry, I was involve with my project's. Please find the attached DWG file. Sample.dwg -
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.
-
Soeren Le Berre joined the community -
Hello. You might have to code a listener on COM or TCP/IP to read nmea stream (depending how you cast your GNSS stream). It is possible with .net to code a plugin that read a com port or TCP/IP stream and then follow the GNSS position in many ways. Inserting Block to the last position Drawing any entities following the GNSS position. Soeren Le Berre
-
Copying layouts with vla-CopyObjects breaks drawing
SLW210 replied to buntobaggins's topic in AutoLISP, Visual LISP & DCL
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. -
DWGDownload.Com joined the community
-
RCMR joined the community
-
Applications that use location services include Windows Maps and Google Earth, for example. There are probably more specialized applications, but I suppose those two are the best known and the best documented.
- Last week
-
Copying layouts with vla-CopyObjects breaks drawing
BIGAL replied to buntobaggins's topic in AutoLISP, Visual LISP & DCL
Why not just use "Layout T" Template it asks for the dwg and which layout i have always used it and no problems. Can run as a (command -
Copying layouts with vla-CopyObjects breaks drawing
buntobaggins replied to buntobaggins's topic in AutoLISP, Visual LISP & DCL
I am aware of the Steal program but for this project I would like to write my own implementation. -
mhupp started following Copying layouts with vla-CopyObjects breaks drawing
-
Copying layouts with vla-CopyObjects breaks drawing
mhupp replied to buntobaggins's topic in AutoLISP, Visual LISP & DCL
https://www.lee-mac.com/steal.html (Steal "C:\\My Folder\\MyDrawing.dwg" '(("Layouts" ("Page1" "Page2")))) -
I worry that information will become like entertainment. We used to have a few TV channels, they were free, and we trusted their information. Then came cable, which grew into a mess of garbage that came through one provider, so you paid for things you mostly didn't want. Then came streaming, which is turning into a handful of providers with even more garbage, and you pay for each provider. AI may turn out like that: a few providers, with answers of questionable quality, at prices we can't afford. What would make sense to me is to create repositories of knowledge, curated by an AI. As it is, you have to ask similar questions, and the AI starts from scratch every time. Wouldn't it make more sense to treat the AI like someone with institutional knowledge? If you had a repository for AutoLISP code, for instance, all of us could contribute to it and maintain it. You might have to pay for your answer, but you would know it was correct and useful.
-
Just like the VLIDE, Visual Studio, Visual Studio Code, etc., you still need to learn to properly us AI to get the code corrected. As I mentioned, Fora were getting slow long before the current AI explosion and particularly for LISP, lots of answers already posted. Many new questions are to alter an existing code to add functionality, that could be easier with AI for someone somewhat familiar with LISP. I still see daily or near daily new member sign ups on CADTutor with out posting, I would presume to download a posted code, since that requires being logged in vs copying and pasting from a code in code tags.
-
Deon Eybers joined the community
-
Rey G joined the community
-
may7 joined the community
-
Like @Steven P How do you look at the data now ? Is it just displayed when you run a program ? If so what is the program ? Some one must have written it.
-
Danielm103 started following AI taking over
-
I think there’s other reasons too! CAD, VisualLISP, have been around for more than a quarter century, AutoLISP, like 40 years, either people have moved on to other software packages, or use an already existing solution People at stack overflow started to complain about it being toxic, people downvote legitimate questions where the question was a bit hard to understand, i.e. where the OP’s first language isn’t English. I use the heck out of AI though; I even run local models. The issue is, people expect LLMs to “one shot” solutions, it’s unlikely to happen. If you spend time and find a system to work with the models, they are amazing.
-
Felix Carter joined the community
-
buntobaggins joined the community
-
Copying layouts with vla-CopyObjects breaks drawing
buntobaggins posted a topic in AutoLISP, Visual LISP & DCL
I am currently writing a program that will take layouts defined in a template file and copy them over to the current drawing. But running this program will cause the the file to break. The new layouts will not show up and if you attempt to switch to a different layout AutoCad will crash. If you try to open the file up again AutoCad will say its corrupted and will repair the file which seems to fix the problem. (defun c:copyLayouts () (vl-load-com) (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq impdwg (getfiled "Select Master Template" "" "dwt" 16)) (setq impdoc (vla-getinterfaceobject (vlax-get-acad-object) (strcat "ObjectDBX.AxDbDocument." (itoa (atoi (getvar 'acadver)))) );vla-getinterfaceobject );setq (vl-catch-all-apply 'vla-open (list impdoc impdwg)) (setq layoat (vlax-get-property impdoc 'layouts)) (setq safeLayout (vlax-make-safearray vlax-vbObject (cons 0 (- (vla-get-count layoat) 1)))) (setq i 0) (repeat (vla-get-count layoat) (vlax-safearray-put-element safeLayout i (vla-item layoat i)) (setq i (1+ i)) );repeat (vla-CopyObjects impdoc safeLayout (vlax-get-property doc 'layouts)) (princ "\n\ncopy done\n\n") (princ) );defun This only seems to be a problem with layouts. Using the same code for say a UCS works just fine. This is probably just some stupid mistake but I have been stuck on this for a while now so any help would be appreciated. -
Are you able to dive into Windows itself a little - been a while since I needed to do anything similar though so this might not be possible. Close everything and set the receiver going, record some data, say 5 mins or something. Windows of old let you search the whole system for every file... might be able to limit that to 'modified in last hour' (or whatever). This might bring up the saved data, might be able to open in notepad and see if it is encrypted / compressed (all the weird characters) or raw data. If is is raw data then you are away and running able to read and modify as you want. Think you would need to show hidden and system files to get the best chance of finding the data. Might work.
