All Activity
- Past hour
-
have nice weekend
- Today
-
Cheers, I have broken my rules... weekend and CAD is off... and now it is weekend and beer time.... CAD is still on.... No, that didn't work - I'll have a look tomorrow or Monday to see if it is my machine doing something odd. Dragon is brilliant, thanks!
-
found the dragon somewhere on line but not sure where anymore , but I know its way above my drafting skills haha. The error is probably the default name for the dat file , on a new system it doesn't exist yet so it has to be created , but think I forgot to put that in yet , wil check it out and update the code. Creating a file c:\\temp\\GrM-Rlx.dat might fix the error for now (that is , if that caused the error) Draak3d.dwg
-
Thanks... looking good though... (oh, you do know that one day I will ask for the dragon - very cool)
-
yes the list is just a plain text file. Seems there still is a gremlin in the app , have to hunt it down... think starting setup dialog while toolbar is active is the culprit, probably better to have tootlbar and setup separate. I will have a look at this.
-
All working. I assume the DAT file is just a list of LISPs, I am getting 'Bad argument value: non-negative: -1' ?
-
Added a few options since the first version for those who like to pimp things. Same restrictons as b4 , text display is very basic , keep them short or use wider buttons , background fill is fine for standard drawings sizes , but very large units can take some time so added option in setup dialog to tweak fill percentage. Very small drawings / zoom factor also impacts fill. But then if I have to live with these limits of lisp , so do you. Very satisfying I can tell you. App can be started with c:GrM (Graphic Menu) , you probably want to fill the app list with your favorite lisp routines and app still works by loading 'MyLisp' and then assumes it starts with (c:MyLisp). Haven't tested it on a virgin system yet so hope it runs on first use. App should display toolbar with default settings and enters a grread loop , there you can select button or press S for setup , O to change orientation (left / right / top / center / bottom) and also do some zooming, oh just read the freaking command prompt. One button(key) isn't listed , D , that was for debugging. Just left it there for those who get off pressing buttons. In setup dialog top left will show if debug mode is active. You probably use it once in you life but it could be a nice template for future apps. You also can directly go to setup dialog with (C:GrMS) Well I could go on but what be the fun in that. If I did my work app should explain itself. My reason for making this is that for every job I do I make my tools on the fly and having to edit / recompile my autocad toolbar every freaking time started to irritate me and now I just pimp my own toolbar / app-list (you can save multiple toolbar data files in the app-list dialog) Well , as you should know by now : hope you have fun or else bite me (or your mother in law) Oh , if you choose center orientation I would advise to use the fixed width / height optiom ... or not , I'm not your mommie, daddy maybe... GrM.lsp
-
could you type or speak a little louder because I can't hear you Steven
-
Steven P started following Voice recognition
-
Got this from CadTutor forums ages ago but lost the link. RLX, was this one of your ideas? Not voice control but spoken feedback, I guess the other half of voice control. 3 Lisps "SpeakSapi", s is the text string to say "SayThis", type in the string and it says it "FreshPrints" cause in work they asked me to do fresh prints.... (Again, RLX, this should appeal to your mind) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun SpeakSapi ( s / sapi ) (if (eq (type s) 'STR) (progn (setq sapi (vlax-create-object "Sapi.SpVoice")) (vlax-put sapi 'SynchronousSpeakTimeout 1) (vlax-invoke-method sapi 'WaitUntilDone 0) (vlax-invoke sapi "Speak" s 0) (vlax-release-object sapi) ) ) ) (defun c:saythis( / s) (setq s (getstring T "What should I say? ")) (speaksapi s ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun c:freshprints () (speaksapi "Now this is the story all about how My life got flipped, turned upside down And I'd like to take a minute, just sit right there I'll tell you how I became the prince of a town called Bel-Air In West Philadelphia born and raised Blah blah blah blah blah I pulled up to a house about seven or eight And I yelled to the cabby yo, holmes smell you later Looked at my kingdom, I was finally there To sit on my throne as the Prince of Bel-Air") ;;(speaksapi "Now this is the story all about how ;;My life got flipped, turned upside down ;;And I'd like to take a minute, just sit right there ;;I'll tell you how I became the prince of a town called Bel-Air ;;In West Philadelphia born and raised ;;On the playground is where I spent most of my days ;;Chilling out, maxing, relaxing all cool ;;And all shooting some b-ball outside of the school ;;When a couple of guys, who we're up to no good ;;Started making trouble in my neighbourhood ;;I got in one little fight and my mom got scared ;;And said, you're moving with your aunty and uncle in Bel-Air ;;I begged and pleaded with her day after day ;;But she packed my suitcase and sent me on my way ;;She gave me a kiss and then she gave me my ticket ;;I put my walkman on and said, I might as well kick it ;;First class, yo this is bad ;;Drinking orange juice out of a champagne glass ;;Is this what the people of Bel-Air are livin' like? ;;Hmm, this might be alright ;;I whistled for a cab and when it came near ;;The license plate said fresh, and had a dice in the mirror ;;If anything I could say that this cab was rare ;;But I thought, nah, forget it, yo holmes to Bel-Air ;;I pulled up to a house about seven or eight ;;And I yelled to the cabby yo, holmes smell you later ;;Looked at my kingdom, I was finally there ;;To sit on my throne as the Prince of Bel-Air") ) Edit: A lie.. not RLX, BigAl https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fun-time-with-speak-function/td-p/5546596
-
rlx started following Voice recognition
-
just google voicecontrol autocad and you get things like voice2cad
-
Danielm103 started following Voice recognition
-
Look at SAPI (Microsoft Speech Application Programming Interface) https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ms720151(v=vs.85) I goofed with Python’s SpeechRecognition library, but I didn’t want to spend the time to sign up for a proper service, i.e. Google’s API, the results were pretty bad. Best approach would be to use a language with support for multi-threading, that way you could have a background thread listing for commands
- Yesterday
-
Hello everyone I'd like to know if it's possible to execute AutoCAD commands using voice recognition. Is this possible using Lisp? Thanks in advance
-
mhupp started following Help with TRIM command
-
I know that's how command line works (typing in points), but you have to pass it a list. so either use getpoint or use the following to hard code x y z. (setq pt2 '(0.5 1.0 0.0)) or (setq pt2 (list 0.5 1.0 0.0)) Asks user to set points with getpoint. used the first point so you can see the fence. defaults do your point if nothing is picked. (setq pt1 (getpoint "\nPick Point<0.5, 1.0, 0.0>: ")) (if (= pt1 "")(setq pt1 '(0.5 1.0 0.0))) (setq pt2 (getpoint pt1 "\nPick Point<0.5, 1.0, 0.0>: ")) (if (= pt2 "")(setq pt2 '(3.0 1.0 0.0))) ; '(makes it a list -edit using @BlackBox Command-s means it wont run the command unless both points are defined. good for error handling
-
BlackBox started following Help with TRIM command
-
(defun c:FOO (/ pt1 pt2) (if (and (setq pt1 (getpoint "\nSpecify first point: ")) (setq pt2 (getpoint pt1 "\nSpecify second point: ")) ) (command-s "._trim" "_o" "_s" "" "_f" pt1 pt2 "" "") ) (princ) )
-
ILoveMadoka started following Help with TRIM command
-
Here is what I am trying to do. Draw a TRIM - FENCE from these two points to cut the vertical lines Here is my code (setq pt1 "0.5,1.0,0.0") (setq pt2 "3.0,1.0,0.0") (command "trim" "fence" pt1 pt2) If I execute this code, I get this (the lines are not trimmed) If I manually type TRIM - FENCE - !PT1 - !PT2 I get this (it works, I have to press enter to finish) What am I missing in getting this code/command to work the way I want?
-
Performance helps for Large-Scale Z-Flattening (Z0) AutoLISP Routine?
BlackBox replied to p7q's topic in AutoLISP, Visual LISP & DCL
It was more of a qualifier... While I'm sure they exist, I've never personally met anyone who used Python and couldn't compile .NET Haha -
Performance helps for Large-Scale Z-Flattening (Z0) AutoLISP Routine?
Danielm103 replied to p7q's topic in AutoLISP, Visual LISP & DCL
FYI, it’s not .NET, it’s Python, so no compiling required https://github.com/CEXT-Dan/PyRx Though .NET certainly would work, the function is AcGeCurve3d::project Maybe similar to PROJECTGEOMETRY -
BlackBox started following LISP to select lines and text according to "Z" values and Performance helps for Large-Scale Z-Flattening (Z0) AutoLISP Routine?
-
Performance helps for Large-Scale Z-Flattening (Z0) AutoLISP Routine?
BlackBox replied to p7q's topic in AutoLISP, Visual LISP & DCL
This thread was mentioned in a similar discussion, so sharing my reply here in kind. If you can compile .NET, use @Danielm103's code - if you instead use Visual LISP, this may help: -
LISP to select lines and text according to "Z" values
BlackBox replied to shokoufeh's topic in AutoLISP, Visual LISP & DCL
This supports both: (defun c:FOO (/ *error* _move _set elev acDoc ss objName pt i) (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) ) (defun _move (prop /) (vla-move x (vlax-3d-point '(0 0 0)) (vlax-3d-point (mapcar '- (list (car (setq pt (vlax-get x prop))) (cadr pt) elev) pt ) ) ) ) (defun _set (prop /) (vlax-put x prop (list (car (setq pt (vlax-get x prop))) (cadr pt) elev ) ) ) (if (and (ssget "_:L" '( (0 . "ARC,ATTDEF,CIRCLE,DIMENSION,ELLIPSE,HATCH,INSERT,*LEADER,LINE,*POLYLINE,MTEXT,POINT,REGION,SOLID,SPLINE,TEXT" ) ) ) ;; someone asked if they could pick a point: ;;(setq elev (getpoint "\nSpecify point for elevation: ")) ;;(setq elev (last elev)) (setq elev (getreal "\nEnter an elevation: ")) ) (progn (vla-startundomark (setq acDoc (vla-get-activedocument (vlax-get-acad-object))) ) (vlax-for x (setq ss (vla-get-activeselectionset acDoc)) (setq pt nil) (cond ((vl-position (setq objName (vla-get-objectname x)) '("AcDbArc" "AcDbCircle" "AcDbEllipse") ) (_set "center") ) ((vl-position objName '("AcDbAttributeDefinition" "AcDbMText" "AcDbText")) (_set "insertionpoint") ) ((wcmatch objName "AcDb*Dimension") (_move "textposition") ) ((= "AcDbBlockReference" objName) ;; <-- test for and ignore xrefs here, if needed (_set "insertionpoint") ) ((= "AcDbLine" objName) (_set "startpoint") (_set "endpoint") ) ((= "AcDbPoint" objName) (_set "coordinates") ) ((vl-position objName '("AcDbHatch" "AcDbPolyline" "AcDb2dPolyline")) (vla-put-elevation x elev) ) ((vl-position objName '("AcDb3dPolyline" "AcDbLeader" "AcDbSolid")) (setq pt (vlax-get x 'coordinates)) (setq i 0) (setq pt (mapcar (function (lambda (n) (setq i (1+ i)) (if (= 0 (rem i 3)) elev n ) ) ) pt ) ) (vlax-put x 'coordinates pt) ) ((= "AcDbMLeader" objName) (setq pt (vlax-invoke x 'GetLeaderLineVertices 0)) (vla-move x (vlax-3d-point (setq pt (list (car pt) (cadr pt) (caddr pt))) ) (vlax-3d-point (list (car pt) (cadr pt) elev)) ) ) ((= "AcDbRegion" objName) (setq pt (vlax-get (car (setq i (vlax-invoke x 'explode))) 'startpoint ) ) (vla-move x (vlax-3d-point (setq pt (list (car pt) (cadr pt) (nth 2 pt))) ) (vlax-3d-point (list (car pt) (cadr pt) elev)) ) (foreach line i (vla-delete line)) ) ((= "AcDbSpline" objName) (if (= :vlax-true (vla-get-isplanar x)) (progn (setq pt (vlax-get x 'controlpoints)) (vla-move x (vlax-3d-point (setq pt (list (car pt) (cadr pt) (nth 2 pt))) ) (vlax-3d-point (list (car pt) (cadr pt) elev)) ) ) (progn (setq x (entget (vlax-vla-object->ename x))) (setq x (mapcar (function (lambda (p) (cond ((and (member (car p) '(10 11 12 13)) (listp (cdr p)) (= 3 (length (cdr p))) ) (list (car p) (cadr p) (caddr p) elev ) ) (t p) ) ) ) x ) ) (entmod x) ) ) ) (T nil) ) ) ) ) (*error* nil) ) -
Integrating Firing Range Software with AutoCAD for Shooting Range Design
SLW210 replied to oddssatisfy's topic in Autodesk Software General
Indoor or Outdoor? Nothing magical for AutoCAD that I know of. Just use general drafting techniques with what regulations you have, some equipment manufacturers have part models, though they could be only for Revit/BIM. Outdoor not much really to do but check regulations for berm heights, structures, shooting benches, any target supports, permanent targets, etc. The rest is just drafting. Indoor you need bulletproof roof, floors and walls (usually concrete), ventilation, acoustics/soundproofing, bullet traps (should be able to get model/drawing/specs from manufacturer), lighting considerations. Something like AutoCAD MEP and Architecture toolsets might be more useful. You might also want some video monitoring, a moveable target system for indoor might be wanted. Each part of the world and particular locations probably have different requirements, so probably no magic button. -
LISP to select lines and text according to "Z" values
SLW210 replied to shokoufeh's topic in AutoLISP, Visual LISP & DCL
As I posted in the other similar thread, I have found for most cases both FLATTEN and FLATSHOT of very little use. Posted somewhere on here are some TOOLBAR MACROs, which IMO does a better job for not too complex drawings to simply get a lot of basic objects to Z=0, as well as LISPs using the same method of moving everything then moving them all back. Initially it was needed for LT, not sure if something better can be used for newer LT with LISP. I'll repost the other thread which gives more on FLATTEN more complicated objects. Performance helps for Large-Scale Z-Flattening (Z0) AutoLISP Routine? - AutoLISP, Visual LISP & DCL - AutoCAD Forums -
LISP to select lines and text according to "Z" values
Nikon replied to shokoufeh's topic in AutoLISP, Visual LISP & DCL
The FLATTEN command explodes MLeader and does not work with dimensions. -
Tapered Offset/Stretch closed polyline shape
SLW210 replied to SLW210's topic in AutoLISP, Visual LISP & DCL
When my workload allows, I'll give it a good run. -
Tapered Offset/Stretch closed polyline shape
GLAVCVS replied to SLW210's topic in AutoLISP, Visual LISP & DCL
P.S.: The interface is available in both Spanish and English. If your operating system language is different, the voice messages will be read in English, but with the pronunciation of your language. If this is your situation and it bothers you, you should search the code for all the English phrases and translate them into your language. It shouldn't take you more than half an hour. You can also mute the speakers . Everyone can do what they think is best.