Is there a way to access Civil 3D's dialog box from a lisp? I want to create a lisp to toggle on/off the surface display of triangles in Civil 3D 2017.
|
Is there a way to access Civil 3D's dialog box from a lisp? I want to create a lisp to toggle on/off the surface display of triangles in Civil 3D 2017.
Welcome to AUGI.
Short answer, is no - LISP will not toggle features in a dialog.
The slightly longer answer, is that you havetwosome other options:
1. You can assign the triangles a Layer in the Surface Style, and use LISP to toggle that Layer's Freeze/Thaw, or On/Off.
... or
2. You can programmatically toggle the Surface Style's display settings, like so:
Code:(vl-load-com) (defun c:TST () (c:ToggleSurfaceTriangles)) (defun c:ToggleSurfaceTriangles (/ *error* acDoc obj) (defun *error* (msg) (if ss (vla-delete ss) ) (if acDoc (vla-endundomark acDoc) ) (cond ((not msg)) ; Normal exit ((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit) ((princ (strcat "\n** Error: " msg " ** "))) ; Fatal error, display it ) (princ) ) (if (ssget '((0 . "AECC_TIN_SURFACE"))) (progn (vla-startundomark (setq acDoc (vla-get-activedocument (vlax-get-acad-object))) ) (vlax-for x (setq ss (vla-get-activeselectionset acDoc)) (vlax-put (setq obj (vlax-get (vlax-get (vlax-get x 'style) 'trianglestyle) 'displaystyleplan ) ) 'visible (1- (abs (vlax-get obj 'visible))) ) ) ) ) (*error* nil) )
Cheers
Last edited by BlackBox; 2016-08-17 at 07:02 PM.
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Agree with @BlackBox
I have a routine that toggles from Style1 to Style2 which basically does what you want, so it's possible...
R.K. McSwain | CAD Panacea |
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Do youmenmean like this?
R.K. McSwain | CAD Panacea |
Yes! I've never seen STRIKE before, actually - it must have been there all along, as I've only ever seen S used at other, better performing sites:
2016-08-17_14-53-36.png
2016-08-17_14-53-25.png
Cheers
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Interesting.The "official" code for strikeout is [s] according to http://www.vbulletin.org/forum/misc.php?do=bbcode, but I don't see any mention of this "hack" being implemented here in the augi forums. Granted, I did not read every single word of this post and each one of the other posts referenced there, but I did skim them fairly thoroughly.
EDIT: Oops. Maybe there isn't a default tag for strikethrough text. Based on some older posts, you have to add your own and I suppose you could use [ s ] or [ s t r i k e] or anything else for that matter.
Last edited by rkmcswain; 2016-08-18 at 12:24 PM. Reason: Correction
R.K. McSwain | CAD Panacea |
[ S ] doesn't seem to do anything here for me. *shrugs*
Anyway, I wonder if the OP will ever check back, and let us know how how they got on...? *not sure*
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
I think this is more what I'm looking for. I'm thinking of implementing a two letter command 'SD' (surface display) to toggle between surface styles.
However, what happens if the current surface style, say Style3, is not one of the styles listed in the routine? I'm interested in learning how to write these routines. Would you mind sharing your routine, as well as any advice on how to learn more about coding? I'm going AU this year and am hoping to go to Midwest University next spring. If you have any specific classes I should take at AU in Vegas I'm all ear's!
Thanks guys!
Landon
This is a toolbar option surprised Blackbox did not mention it, you can turn on/off any surface, if one surface it acts straight away if more than one asks which one to change via DCL. You can turn on a surface or off no need for any Toolspace interaction, we use it everyday you will have to look at the code and change your surface style names to suit. The icons are a bit rough but it was easy to make so imperial versions could be created pretty easy.
I would appreciate any comments about its use.
Last edited by BIG-AL; 2017-11-09 at 02:25 AM.