I have to say besides all the stress you can relieve with ChatGPT poking fun at dev teams and such, it is actually useful for real world solutions. I know nothing about LISP, yet within one minute I made a mundane task of executing the units command and clicking a few times way easier. ...Also the ability to change it if I want to customize. It really works! It works as a units toggle between the two types of units I use while modeling.
wow and gratulation, this must continue to develop
I had realized that it was not showing decimal places so based on what I just learned I figured out how to fix that without Rudys help..
(defun c:chgunits ()
(setq oldunits (getvar "lunits"))
(if (/= oldunits 2) ; check if not already decimal inches
(progn
(setvar "lunits" 2) ; set units to decimal inches
(setvar "luprec" 2) ; set units precision to 2 decimal places
(princ "\nDrawing units changed to decimal inches."))
(progn
(setvar "lunits" 4) ; set units to architectural
(setvar "luprec" 0) ; set units precision to nearest 1/16 inch
(princ "\nDrawing units changed to architectural."))
)
(princ)
)
you mean length units and precision, you can show the current values via MODEMACRO in the status bar 😁
Thanks @bigcarl5000kg I didn't know that one. I already have the button on my Stream Deck 😄
Can you ask Rudy if we are getting AS2024?
Buddy (my bot) says "it is confidential".
If this information was helpful, please use the Accept as Solution function, this makes it easier for other users.
Regards,
Ilko Dimitrov, IDC-1, M. Eng.
Tekla and Advance Steel Detailer
ACBS Structural Steel Detailing
If it is made of steel, I can model it and detail it.
Lol
If this information was helpful, please use the Accept as Solution function, this makes it easier for other users.
Regards,
Ilko Dimitrov, IDC-1, M. Eng.
Tekla and Advance Steel Detailer
ACBS Structural Steel Detailing
If it is made of steel, I can model it and detail it.
Whatever, who cares.
(Mark, not a response to you. It was moved here by whatever.)
If this information was helpful, please use the Accept as Solution function, this makes it easier for other users.
Regards,
Ilko Dimitrov, IDC-1, M. Eng.
Tekla and Advance Steel Detailer
ACBS Structural Steel Detailing
If it is made of steel, I can model it and detail it.
OMG!
It has it's days.
It looks like the issue with your Lisp code for toggling between architectural units with 1/16" precision and decimal units is that the precision for architectural units (1/16") is not correctly set. In AutoLISP (used in Autodesk products like AutoCAD), architectural units with 1/16" precision are set by using LUPREC value of 2, not 3. The LUPREC value of 3 corresponds to 1/32" precision. Here's the corrected code:
This version correctly toggles between architectural units with 1/16" precision (LUPREC set to 2) and decimal units with 4 decimal places precision (LUPREC set to 4).
The term "LUPREC" 4 in AutoLISP, used with the setvar function, refers to setting the precision of linear unit measurements in AutoCAD. "LUPREC" stands for Linear Units Precision, and the number following it specifies the level of precision.
This precision setting is especially relevant when working with decimal units. For architectural or fractional units, "LUPREC" values correspond to different fractions of an inch (e.g., 1/16", 1/32", 1/64", etc.), but the value 4 specifically applies to decimal unit settings.
I see there's a misunderstanding in the last part of your statement. Setting LUPREC to 4 when changing to architectural units does not achieve 1/16" precision. The LUPREC setting for 1/16" precision in architectural units should be 2, not 4.
The value of LUPREC dictates the precision of the unit display:
Here's how the corrected part of the code should look if you're aiming to set the precision to 1/16" when toggling to architectural units:
This adjustment ensures that when you toggle from decimal units with four decimal places to architectural units, the precision is correctly set to 1/16".
I understand the confusion around this topic, and I appreciate your patience. To clarify, the value assigned to "LUPREC" for specifying precision in AutoCAD can indeed vary based on the context and version of the software. My previous explanation was based on common settings, where "LUPREC" values for architectural units typically correspond to fractions of an inch, with each value representing a specific fraction.
However, if there's any confusion or if the behavior in a specific version of AutoCAD seems different, it's important to consult the official documentation or test the settings directly in the software. AutoCAD's documentation or the command line can offer guidance on what each "LUPREC" value corresponds to in terms of precision for both decimal and architectural units.
To directly address your question with the most accurate information, let's re-evaluate the "LUPREC" value:
Given the nature of software documentation and updates, it's entirely possible for discrepancies to arise in explanations. If the goal is to ensure 1/16" precision in architectural units and there's uncertainty about the correct "LUPREC" setting, the most reliable approach would be to consult the latest AutoCAD documentation or reach out to AutoCAD support.
If you have direct access to AutoCAD, you could also try changing the "LUPREC" value and observe how the software rounds and displays measurements in architectural units, thus finding the exact setting that meets your requirement for 1/16" precision.
Thank you for confirming your findings with AutoCAD. If setting "LUPREC" to 4 in your version of AutoCAD results in 1/16" precision for architectural units, then that's the correct setting for your specific use case. Software behavior can vary with different versions and settings, so direct experimentation and verification like yours are invaluable. I appreciate your patience and the clarification. This is a great reminder of the importance of hands-on verification and consulting specific software versions for accurate information.
Based on the output you've provided from AutoCAD, it's clear that setting LUPREC to 4 does indeed result in measurements being displayed with a precision that includes fractions equivalent to 1/16". This output demonstrates that the LUPREC value influences the smallest fraction of an inch displayed in architectural measurements, with 4 allowing for precision up to 1/16".
Your example effectively shows how changing the LUPREC setting from 3 to 4 affects the display of measurements, making them more precise by including smaller fractions of an inch in the display output. This is a practical demonstration of how AutoCAD's unit precision settings work in terms of displaying architectural measurements.
Thank you for sharing this detailed example, which clearly illustrates the effect of the LUPREC setting on measurement precision in AutoCAD. It's an important clarification that LUPREC 4 provides the desired 1/16" precision for architectural units in your version and setup of AutoCAD.
Based on your confirmation that LUPREC set to 4 achieves 1/16" precision in architectural units in your setup, here is the corrected AutoLISP script for toggling unit settings with the desired precision levels:
This script now correctly reflects the understanding that LUPREC 4 is used for achieving 1/16" precision in architectural units, and it toggles between decimal and architectural units while maintaining the appropriate level of precision for each. When the script detects the current setting as decimal with 4 decimal places, it switches to architectural units with 1/16" precision, and vice versa. If the units are neither decimal with 4 decimal places nor architectural with 1/16" precision, it defaults to setting the units to decimal with 4 decimal places.
I run out of free asks before it ever wrote a lisp for me that worked, and I've tried dozens of times
@bryan_herronH8R6A What would you like the lisp to do? Maybe I'll give it a shot 🙂
Something I wanted to try for a while...
Shared chat with Steely McFeely (chatbot I created)
To do anything complicated with Chat GPT (lisp or VBA) I find I have to ask it to do small things, and then I build up from there. I check the code at every step. Then I piece together what works. I have yet been able to get anything working from chat GPT with a single prompt.
Here's my latest attempt. Autodesk completely ignores all the pipe network entities when you dynamically hatch the cut or fill in the profile views and hatches right over them when they are in the hatched area. These items should not be hatched through. The goal with this one was to keep the hatch out of the pipe network entities. Ultimately this would be a sysvar instead of a command.
ProPipeHatch - 0 being the default, 1 eliminating the hatch inside the pipe network entities, but I suppose if Autodesk would let us select the pipe networks along with the surfaces when we are designating the cut/fill hatching, that would be just as good.
Hi @markhubrich,
what did you end up using for your task and with what success?
Well here's one. I just wanted a lisp that would chang hatch pattern of all hatches based on user input. This is how the chat went
https://chatgpt.com/share/a3babd7b-46d0-4580-86ae-fb03592f9fd4
I had to correct some of the vlax property names as the ones suggested did not exist
Hey @bigcarl5000kg
I literally just attempted the "place beams by layer" thing this morning. So far it can find all lines that belong to W_12X26 and place a beam along them. I will push this further, but not today. I want to have it populate a line model based on what the layer names are. It will take trial and error but it just might work.
Other things in the past, like toggle my units between 4 decimal places and arch 1/16" is very handy. That's about as deep as I went with it for AS. It knows the Python in Grasshopper for Rhino very well. I am generating files in Rhino that I import into AS, but I manually put the beams in.
Can't find what you're looking for? Ask the community or share your knowledge.