Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. 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.
  3. No its mine, So sorry, I was involve with my project's. Please find the attached DWG file. Sample.dwg
  4. Today
  5. GLAVCVS

    GNSS on AutoCAD

    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.
  6. Soeren Le Berre

    GNSS on AutoCAD

    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
  7. 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.
  8. PGia

    GNSS on AutoCAD

    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.
  9. Yesterday
  10. 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
  11. I am aware of the Steal program but for this project I would like to write my own implementation.
  12. https://www.lee-mac.com/steal.html (Steal "C:\\My Folder\\MyDrawing.dwg" '(("Layouts" ("Page1" "Page2"))))
  13. CyberAngel

    AI taking over

    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.
  14. SLW210

    AI taking over

    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.
  15. BIGAL

    GNSS on AutoCAD

    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.
  16. Last week
  17. Danielm103

    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.
  18. 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.
  19. Steven P

    GNSS on AutoCAD

    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.
  20. Nikon

    AI taking over

    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!!!
  21. PGia

    GNSS on AutoCAD

    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.
  22. ryanatkins49056

    AI taking over

    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.
  23. BIGAL

    GNSS on AutoCAD

    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 ?
  24. "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."
  25. mhupp

    GNSS on AutoCAD

    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
  26. PGia

    GNSS on AutoCAD

    An external application? Wich one? Is there any software available that can do this?
  27. 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
  28. Steven P

    GNSS on AutoCAD

    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
  29. BIGAL

    GNSS on AutoCAD

    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.
  1. Load more activity
×
×
  • Create New...