Need a list of constants in visual lisp

Need a list of constants in visual lisp

dvertz
Collaborator Collaborator
239 Views
12 Replies
Message 1 of 13

Need a list of constants in visual lisp

dvertz
Collaborator
Collaborator

I currently have about 400 of the defined constants but I am still missing some. I don't know how many I am missing, but I know I am missing "acmiddlecenter". I am looking for the one that does the middle left. I am currently guessing at "acmiddleleft" but I won't know for sure until I run my function to see if it fails. I would just like to get the list of all constants that are defined. I searched the internet but I am just know hitting on the right keywords to find it. Thanks.

Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


0 Likes
Accepted solutions (1)
240 Views
12 Replies
Replies (12)
Message 2 of 13

daniel_cadext
Advisor
Advisor

For ActiveX? Python wrappers have them generated here

https://github.com/CEXT-Dan/PyRx/blob/main/pyrx/PyAx.pyi

 

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
0 Likes
Message 3 of 13

Kent1Cooper
Consultant
Consultant

I'm not quite sure I understand what you're asking, because it sounds like you want variables, which is the opposite of constants, but which you can define [you can't "define" a constant, which is fixed -- things like pi].  But in any case, does the (atoms-family) AutoLisp function [>here<] do what you want?

Kent Cooper, AIA
0 Likes
Message 4 of 13

daniel_cadext
Advisor
Advisor

I’m assuming something like (setq acmiddlecenter 5), if that's the case the link I posted might be helpful 

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
0 Likes
Message 5 of 13

paullimapa
Mentor
Mentor

You can see them with command:

FIELD

Field category: Other

Field names: LispVariable

paullimapa_0-1756952266100.png

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 6 of 13

komondormrex
Mentor
Mentor
Accepted solution

find *middle* masked

Command: LSP

Enter an option [Commands/Functions/Variables/Load]: V

Enter Variables to list <*>: *middle*

ACALIGNMENTMIDDLE             (INT)
ACALIGNMENTMIDDLECENTER       (INT)
ACALIGNMENTMIDDLELEFT         (INT)
ACALIGNMENTMIDDLERIGHT        (INT)
ACATTACHMENTMIDDLE            (INT)
ACATTACHMENTMIDDLEOFBOTTOM    (INT)
ACATTACHMENTMIDDLEOFTOP       (INT)
ACATTACHMENTPOINTMIDDLECENTER (INT)
ACATTACHMENTPOINTMIDDLELEFT   (INT)
ACATTACHMENTPOINTMIDDLERIGHT  (INT)
ACHORIZONTALALIGNMENTMIDDLE   (INT)
ACMIDDLECENTER                (INT)
ACMIDDLELEFT                  (INT)
ACMIDDLERIGHT                 (INT)
ACTOLMIDDLE                   (INT)
ACVERTICALALIGNMENTMIDDLE     (INT)

ac* masked, guess all acad's. with logging on all are written to the current log file. 

Command: LSP

Enter an option [Commands/Functions/Variables/Load]: va

Enter Variables to list <*>: ac*

AC0DEGREES                    (INT)                         
AC1_1                         (INT)                         
AC1_10                        (INT)                         
AC1_100                       (INT)                         
AC1_128IN_1FT                 (INT)                         
AC1_16                        (INT)                         
AC1_16IN_1FT                  (INT)                         
AC1_2                         (INT)                         
....
                        
ACWHITE                       (INT)                         
ACWINDOW                      (INT)                         
ACWORLD                       (INT)                         
ACXLINE                       (INT)                         
ACYELLOW                      (INT)                         
ACZERO                        (INT)                         
ACZOOMSCALEDABSOLUTE          (INT)                         
ACZOOMSCALEDRELATIVE          (INT)                         
ACZOOMSCALEDRELATIVEPSPACE    (INT)

 

0 Likes
Message 7 of 13

Moshe-A
Mentor
Mentor

@dvertz hi,

 

why realy care what value these constant holds, in expression i use them like they were integers

(setq alignments (+ acAlignmentAligned acAlignmentMiddle acAlignmentFit acAlignmentTopLeft))

and if i need the value...use (prompt (itoa acAlignmentMiddle))

 

Moshe

Message 8 of 13

dvertz
Collaborator
Collaborator

Daniel,

Yes. Active X

Thanks, This is very close to what I was looking for and then some.

Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


Message 9 of 13

dvertz
Collaborator
Collaborator

There are many constants defined in lisp to use instead of variables. Variables can change. The "acmiddlecenter" is a constant that never changes.

Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


0 Likes
Message 10 of 13

dvertz
Collaborator
Collaborator

Ah. I did not know this. Its a perfect list. I just wish I could now extract them as text. As my intended use for the text is to place them in my "word file" for UltrEdit. I use UltraEdit for alot of my coding when I am working on a machine without Autocad installed. And having syntax highlighting is great.

Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


0 Likes
Message 11 of 13

dvertz
Collaborator
Collaborator

Wow. That looks like is gives the list I was looking for. I just used "*" to get all of the constants/variables. Now I will need to sort through them.

Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


0 Likes
Message 12 of 13

dvertz
Collaborator
Collaborator

I don't care what the value is of the constant.

See my reply to paullimapa. I explained there what my use for the list of constant is being used for.

Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


0 Likes
Message 13 of 13

dvertz
Collaborator
Collaborator

To follow up ... this worked perfectly. I pasted the list into UltraEdit and sorted through them to remove items I did not need. That did not take long. Then I did a find and replace to remove the "(INT)" and others. Then performed a trim trailing spaces. I copied and pasted that list into the "word file" and saved it. The result was perfect. The Orange are the new constants from the list.

dvertz_0-1756989449477.png

 

Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


0 Likes