AutoCAD Architecture Forum
Welcome to Autodesk’s AutoCAD Architecture Forums. Share your knowledge, ask questions, and explore popular AutoCAD Architecture topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom Lisp

8 REPLIES 8
Reply
Message 1 of 9
twallacemagee
632 Views, 8 Replies

Custom Lisp

Does anyone know why this LISP will not work in AutoCAD Architecture 2013 or 2014 and what I would need to adjust to get it to work.

 

(defun c:FQ ()
  (command "FILLET" "R" "0")
  (setq osval (getvar "osmode"))
  (command "FILLET" PAUSE PAUSE)
  (command "osmode" osval))

8 REPLIES 8
Message 2 of 9
pendean
in reply to: twallacemagee

is it hanging because you did not finish Fillet command when you reassigned the radius? It requires another <enter> if I just type it at the command line.

Message 3 of 9

This worked fine just as it is in Rel, 14 through 2012,  Works fine in AutoCAD 2013 (lauched and us the 'AutoCAD classic' in the workspace selection) but not in AutoCAD Architecture 2013 or AutoCAD Architecture 2014 (have not figured how to launch AutoCAD 2014 with-out the Architecture portion).

 

All I get is Command: fq Unknown command "FQ".  Press F1 for help.

Message 4 of 9

In ACA 2010, the code you posted creates a command function called FQ, but running it fails.  The problem is not that FQ is undefined, but that the FILLET command is:

Command: fq
Unknown command "FILLET".  Press F1 for help.
Unknown command "R".  Press F1 for help.
Unknown command "0".  Press F1 for help.
Unknown command "FILLET".  Press F1 for help.

 

That may be due to the fact that the ACA profile undefines the FILLET command, and redefines it with the AECFILLET command.  That redefinition does not appear to be recognized by AutoLISP, although the undefinition is.  You can edit your code to place a period in front of both calls to the FILLET command or change the command to the AECFILLET command.  The former method will not work on Walls (which is why the FILLET command is undefined and redefined as AECFILLET in ACA), the latter may not work if you are working in a vanilla AutoCAD profile.

 

(defun c:FQ ()
  (command ".FILLET" "R" "0")
  (setq osval (getvar "osmode"))
  (command ".FILLET" PAUSE PAUSE)
  (command "osmode" osval)
)

 or

(defun c:FQ ()
  (command "AECFILLET" "R" "0" "")
  (setq osval (getvar "osmode"))
  (command "AECFILLET" PAUSE PAUSE)
  (command "osmode" osval)
)

Note that the AECFILLET version requires an extra return in the first call, to fully exit the command.  Not quite sure what you are doing with the OSMODE system variable, as you only save the current value and then restore it.  Perhaps there is a missing line where you set it to zero before the second call to the FILLET (or AECFILLET) command?


David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
EESignature

Message 5 of 9

Thank You that worked.  Tired the _ before but did not know about the dot.  To the other it was a test that I did not get working and never deleted or went back to try to fix and proceeded to forget about until you asked what I was try to do with it.

Message 6 of 9

OK, now updated to AutoCAD Architecture 2015 and the modifications recommended and implemented do not work again.  Does anyone have any suggestions?

Message 7 of 9

I currently only have access to the final beta for AutoCAD Architecture 2015, but both versions previously posted worked for me in that version.  Unless something was changed in the shipping version, it should work.  You are running AutoCAD Architecture as AutoCAD Architecture, and not as plain AutoCAD, right?


David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
EESignature

Message 8 of 9

Sorry, it is working fine today, not sure why it did not work for me last week.  FYI "C:\Program Files\Autodesk\AutoCAD 2015\acad.exe" /ld "C:\Program Files\Autodesk\AutoCAD 2014\AecBase.dbx" /p "Tim" /product "ACA" /language "en-US" is the target in my AutoCAD short cut.

Message 9 of 9

Wrong, it works if I use the default "C:\Program Files\Autodesk\AutoCAD 2015\acad.exe"  /p "AutoCAD" /product "ACA" /language "en-US" and it asks me about 'File Loading - Security Concern" and prompts me to load each of the LISP files (no folder is selected in the 'trusted locations).  In my "C:\Program Files\Autodesk\AutoCAD 2015\acad.exe" /ld "C:\Program Files\Autodesk\AutoCAD 2014\AecBase.dbx" /p "Tim" /product "ACA" /language "en-US" I have the preferences to list the folder that these lisp's are in to be a 'Trusted Location' but it seems to not be allowing them to load.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost