All Activity
- Past hour
-
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.
- Today
-
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.
- Yesterday
-
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.
- Last week
-
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.
-
As an dilettante, I want to say that AI exists only thanks to professionals like you. All the training materials and a lot of codes are written by real people. Therefore, all the applause is for you and only for you!!!
-
As I mentioned, it is an integrated u-blox M8N receiver built into the motherboard of a Unistrong UT50 tablet PC running Windows 10. It is a tablet that is about 10 years old, so it has already been discontinued.
-
AI is definitely seeing more use. At work myself and one other are generally maintaing our AutoLISP libraries. I only started learning around 2021 as it is while he's been doing it alot longer. We've both made attempts at creating CoPilot agents to help ourselves out and see what it does. I know other CAD users have used various AI to spit out AutoLISP commands to make life easier which is fine. But thankfully they had the foresight to come to one of us when it didn't work. I've been pushing for not an outright ban on AI coded AutoLISP but trying to get all code passed through myself or the other guy as a few I've seen so far when help was asked for were deleting files out of shared directories. Which of itself wasn't terrible as they were temporary files that were being created by the subfunction but blindly testing something with that level of access worried myself, the other guy and two of our CAD managers.
-
abdalrhman joined the community
-
Some suggestions. Go back to who you bought the device from, they may have something. If it was say Amazon not sure. Look on the manufacturers web site for more info contact them. Brand, model etc ?
-
Parametric wardrobe, kitchen & cabinet automation in AutoLISP — anyone working on similar?
zenmar replied to zenmar's topic in BricsCAD
"Thanks for confirming. That completely locks in my decision to statically link SQLite into the BRX—it's clearly the only safe way forward to avoid process space conflicts. DuckDB and Arrow are powerful, but definitely overkill for a parametric generator framework. Keeping it clean with zero external DLL dependencies is the way to go." -
In real time? I think is saw one for like $300 will post later tonight. -edit I can't find it was like dtool or something
-
An external application? Wich one? Is there any software available that can do this?
-
Cleaning Up the Clutter with AutoCAD Wipeout and Text Masking: Tuesday Tips With Frank
The AutoCAD Blog posted a topic in AutoCAD Blogs
In a recent Tuesday Tips, I focused on some solutions for the poor drafting practice of not having your annotations in alignment. This time, the focus will be on overlapping objects and annotations. The drafting rule is quite simple: don’t overlap things. But as we learned from that pirate movie franchise, sometimes rules are more guidelines than actual rules. By that, I mean that there are times when overlaps are just unavoidable. However, there are some tools in AutoCAD that let you hide objects in these cluttered areas. AutoCAD wipeouts and text masking are the focus of today’s Tuesday Tip. Wipeout Consider the image below. Having the line appear behind the pneumatic gate valve symbol is a big no-no. These days, programs such as Plant 3D take care of this for you, but if you’re using an old-fashioned symbol library, your only option is to trim out the line within the block. Not an optimal solution. Instead, we’ll add a Wipeout object to the block definition. In the next image, you’ll see the valve block open in the Block Editor, and we can find the Wipeout tool in the Markup panel of the Annotation tab. It’s incredibly easy to use; if you can draw a polyline, you can create a Wipeout. Select points and enter close to end it, or you can choose an existing polyline (then erase it or not), In our case, we want the wipeout to take on the same shape as the valve symbol, or a “bowtie” shape. Using an Endpoint Osnap, select the corners of the valve in the order shown. Save the edited block, and return to the drawing editor. If you’re following along at home, the red lines are probably not hidden. If the block already exists, as it does in our example, you may need to change the draw order of the newly edited block. Select all instances (a good use of Select Similar, or Quick Select), then right-click, expand Draw Order, and select Bring to Front. Your wipeout should now hide the red line behind it. Wipeouts come with an additional control you’ll need to know about. There is a system variable that controls how the frame, or outline, of the wipeout works. The variable is WIPEOUTFRAME, and you can set it to 0, 1, or 2, which correspond to: 0: The frame is not visible, and it is not plotted. The frame temporarily reappears during selection preview or object selection. 1: Displays and plots the frame. 2: Displays, but does not plot the frame. A lot of underlay image objects have their own setting (such as PDFFRAME), and the FRAME command itself controls all of them. Sounds confusing, doesn’t it? Don’t worry, I’ve got you covered. I wrote about it a few years ago. Just go here (after you finish this blog) to learn all about it. Text Masking A close cousin to Wipeouts are Background Masks. Think of them as specialized wipeouts that work only with MTEXT objects. Consider the image below. The drawing contains a detail callout block with an MTEXT object identifying the area as Detail C. Its placement falls on top of the objects above it. It’s poor drafting to say the least. Again, I’ll edit the block via the Block Editor. I’ll double-click on the MTEXT as if I’m going to edit it (which I am). The Ribbon will switch to the contextual Text Editor tab, where I’ll click on the Mask tool from within the Style panel. You’ll immediately be presented with the Background Mask dialog. It’s pretty simple. There’s a checkbox to use a mask or not. That’s why I’m here, so I’ll make sure it’s selected. I don’t want a special color for the mask (are you trying to call attention to your text? Perhaps you’ll want to set a color). We want our mask to be effectively invisible, so I’ll select the Use drawing background color checkbox. If I left it unchecked, I could select my color from the widget on the lower right side. When you’re done, save the block, and you should see the mask applied to the block’s text as shown in the image below. In the example, there’s some extra space above and below the text. That’s the offset factor that you saw in the mask dialog. A Few Final Thoughts In both examples, I added the Wipeout and Text Mask to existing blocks. Obviously, they work straight from the drawing editor as well, and you’ll probably never encounter the Draw Order issue – at least at the time of their creation. And yes, I know, the examples were a bit flawed as well. I alluded to that with the valve symbol. I doubt if any serious piping designer would be using such old-school blocks, but it helped drive home the point. And, what about the Detail C symbol block? Making the text into an attribute and adding a dynamic Move action would be a better way to manage the block. But thanks for sticking with me! Of course, you should make every effort to use good drafting techniques. If at all possible, you should avoid these object overlaps whenever you can. But when it’s not possible, these masking tools can help you keep your drawing clean. More Tuesday Tips Check out our whole Tuesday Tips series for ideas on how to make AutoCAD work for you. The post Cleaning Up the Clutter with AutoCAD Wipeout and Text Masking: Tuesday Tips With Frank appeared first on AutoCAD Blog. View the full article -
Yeah, my thought would be to use an external app to talk to the receiver, save the coordinates to a text file somewhere continuously - probably by overwriting a simple text file 'X-Coord Y-Coord Z-Coord Description' - same format all the time - all done outside of CAD. Have CAD running and using a delay (https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-delay-command-in-scripts/td-p/5497881 for an example) get CAD to read this file as necessary, plot the point
-
Your trying to talk to an external device, something that Autocad was never really designed to do out of the box.. Other than say a Digitiser. Yes in survey software including CIV3D there are programs that talk to survey instruments, but some one has writen say a .NET interface to do the talking part. So you need a external program Python may do it for you, Lisp is a pretty low level language when it comes to interfaces. You need functions that do that and they are probably not built into the Lisp interpreter. Bricscad has added lisp functions to its software they are not available to say Acad as improvements. In the case of mobile phone photos I used a 3rd part program to read the details from the jpg images so could get the lat and long and insert in a dwg at correct location. Using lisp could call the other external program. look at Startapp can call a bat file. "Need a thread" then why not talk to hand held distance measures, I am sure others would come up with other devices also that they would like plug and play.
-
Parametric wardrobe, kitchen & cabinet automation in AutoLISP — anyone working on similar?
Danielm103 replied to zenmar's topic in BricsCAD
SqliteLisp’s only dependency is the BRX SDK. I compiled SQLite as a static library so it can be truly embedded. it’s not hard to extract the parts you need, along with the SQLite source to create a BRX. You’re correct in that you would need to build for every BricsCAD version you intend to ship with. If you have an external program also using SQLite, it’s likely you will need two instances, one for your program, one for BricsCAD. Even though they might be compiled differently, reading the database file is guaranteed. Here’s the problem using a SQLIte as a .DLL, BricsCAD already uses a customized version of SQLite internally, that means you cannot use another version within BricsCAD’s process space, you’re forced to use BricsCAD’s and you don’t know what they have changed or what extensions they have enabled. You’ll have no control on the BricsCAD side. That's why static embedded in a BRX is better, you can load in your own instance, compiled with your own flags. Another option is to use DuckDB, it may be possible to build a .DLL interface for lisp and your external program. DuckDB is incredibly fast with certain storage methods, DuckDB also supports Apache Arrow, next generation high performance embedded database. -
Parametric wardrobe, kitchen & cabinet automation in AutoLISP — anyone working on similar?
zenmar replied to zenmar's topic in BricsCAD
Thanks for the example, BIGAL! Nested/child DCLs (like the one in image_4483c9.png) are a great, proven way to handle multi-level configurations without cluttering the main screen. Regarding Excel as a database—you're absolutely right that 99% of users know how to use it, and using a text file for user-defined layers is an excellent way to keep things flexible. However, for a complex parametric generator, I heavily lean towards SQLite over Excel for a few critical reasons: Performance & Overhead: Reading/writing heavy datasets via COM (vlax-get-or-create-object) creates noticeable lag, especially when querying "zillions" of hardware parameters in real-time. SQLite executes queries in milliseconds completely in-memory or via a tiny local file. Zero Dependencies: Using Excel via ActiveX means the user must have Microsoft Excel installed. If they use LibreOffice, Google Sheets, or a different CAD platform setup, the COM links break or require entirely different codebases (as you mentioned having separate LibreOffice code). SQLite runs natively inside the LISP environment without caring what office suite is installed. Stability: We've all experienced ghost EXCEL.EXE processes hanging in the Windows Task Manager when a LISP routine crashes or fails to unallocate the object properly. SQLite avoids that entirely. That being said, I am planning an "Export to Excel/CSV" feature for BOMs (Bill of Materials) and cutting lists, because as you perfectly pointed out, Excel is the universal language for production managers and workshop staff! Thanks for the snippet and the food for thought! Zen
