Showing posts with label AutoCAD. Show all posts
Showing posts with label AutoCAD. Show all posts

Monday, October 27, 2014

Missing Or Hidden Dialog Boxes in AutoCAD

Ever have dialogs disappear in AutoCAD and not be able to access them without what seems to be CTRL-ALT-DEL and exiting the software? This blog post helped me out greatly to solving the issue when using multiple monitors and the dialogs disappearing: http://autodesk.typepad.com/beyondthebox/2013/10/missing-or-hidden-dialog-boxes-in-autocad.html

Additionally, I've had some app dialogs disappear and the command remains running but inaccessible due to accidentally clicking off of the dialog. How do you gain access back? Here's an example and how.

Here I've used an app from the app store and the dialogs appear - (App is Set Multiple Object Styles for Civil 3D)

 In the image below, I've accidentally clicked off of the dialog and the focus goes back to AutoCAD Civil 3D. The dialog has disappeared but the command is still running - see command line. No obvious way to access the dialog.
However, we can get around this issue by cycling through our running applications using ALT + TAB. Then use the arrow keys to move over the AutoCAD Civil 3D icon, at which point you will see text noting the dialog that is currently running. Upon selecting the AutoCAD Civil 3D icon the running dialogs will appear again allowing for selection and completion of the command.

 






Tuesday, July 9, 2013

AutoCAD 2014 - New Security Features

One of the newest features in the 2014 product(s) is the implementation of security features. With the AutoCAD* (verticals included) malware going around, Autodesk has implemented two new variables that work as a blocking mechanism for loading external code files - that is, LISP Routines, .NET Files, etc. You can read more about the malware going around here and here.

This new system has it's positives and negatives for sure. Obviously good because it provides added prevention to loading external malicious code, but can be seen as bad because it's an additional dialog for every file you need to load with workflow routines.

 
There are a few ways around this system, as always, and with limited information being out on the web I thought I'd provide some additional things I have found. Of course there is always a way to turn these things off all together which can be accomplished with the new setting SECURELOAD - though this is not recommended as it will leave you vulnerable. You can read more about this here.
 
Manually, you can go into the Options menu, Files Tab, open up Trusted Locations and add the folders of trusted paths. Note that if the path is not set to READ ONLY, AutoCAD will prompt you to manually allow - but this is not recommended as malicious code could save a file into a write enabled path. Once paths are added here, AutoCAD will allow loading of any files in the path without the above dialog appearing. I believe that this is restricted to files directly under the main folder and not under sub folders, though I have not found documentation on this.
 
 
Additionally trusted locations can be added from the command line with the new command TRUSTEDLOCATIONS. Each path can be written out and separated by semicolons ";". For example, C:/This/Is/My/Path;C:/This/Is/Another/Path.
 
With much of AutoCAD* allowing for a cloud based system for file storage, trusted domains can also be added via the command TRUSTEDDOMAINS; again via separated by semicolons ";". You can read more about this here and here.
 
Another way to deal with loading external files is with the recent auto loading system that debuted in AutoCAD 2012 and made it to many AutoCAD verticals in 2013. AutoCAD* 2014 will automatically load bundle files from the Autodesk plugins folder. The bundle files can get quite involved as they are setup to run on multiple platforms as programmed by the developer, thus I won't get into how they work here in this blog, however you can read up more on this here and here.
 
Of course the autoloader system is great, but it can be a bit overwhelming for those who do not do a lot of programming. Thus I have created a LISP routine that can be used for setting the trusted path locations automatically (this could easily be modified for domains as well). Take the code below and paste into a text file and save as a LISP routine - then modify the paths to your own (shown as red text below). This code can also be added into an ACAD.lsp file and saved in the program support folder as AutoCAD will still autoload from there without the security dialogs as well.
 
 
;;SET TRUSTED PATHS
;;Written by Steve Hill, 7/3/2013
;;www.beyondcivil3d.blogspot.com
 
;;This function checks if string 1 (s1) contains string 2 (s2)
;;If not, it combines string 1 and string 2 with a semicolon in between and returns the new string.
;;If it does, it just returns the first string
(defun addtrustedpath ( s1 s2 )
 

           (if (= (strlen s1) 0)
 
                  (progn
                         (strcat s1 s2)
                  );progn
 
                 (progn
                         (if (= (vl-string-search s2 s1) nil)
                                   (progn
                                            (strcat s1 ";" s2)
                                   );progn
                                  (strcat s1)
                          );if
                  );progn
 
             );if
);end defun
 
 
;;This function begins with the trusted path string obtained in the next function (p1).
;;If nothing, it begins with nothing. We then add the paths listed below to this string.
;;The Addtrustedpath function checks to make sure the path does not already exist.
(defun trustedpathstring ( p1 )

              (setq p1 (addtrustedpath p1 "C:\\My\\Path\\Number1"))
               (setq p1 (addtrustedpath p1 "C:\\My\\Path\\Number2"))
              (setq p1 (addtrustedpath p1 "C:\\My\\Path\\Number3"))
              ;;copy code on line above and change path to add more paths here
              ;;continue until all of your trusted paths are added to code here.
);end defun

;;This function gets the current trusted paths, then passes the string to the above function
;;And finally sets the trusted paths variable obtained from the above functions
(defun settrustedpaths ()

              (setq currpaths (getvar "trustedpaths"))
              (setvar "trustedpaths" (trustedpathstring currpaths))
);end defun

(settrustedpaths)

(princ "\n\n****Trusted paths have been set****")
    
Overall, the new security features are a good thing. I recommend leaving them on to ensure your system is not loading malicious code files. Please feel free to comment if you have any better suggestions.

 
 
 


Monday, December 10, 2012

Autodesk Exchange Store CUI Issues - RESOLVED!!

Here is a great post from Augusto Goncalves regarding the Autodesk Exchange app plugins. Some may have seen duplicate 'Plug-In' or 'Add-In' ribbon tabs when installing apps from the store. A simple change to your CUI will solve this issue.

http://adndevblog.typepad.com/infrastructure/2012/12/duplicated-add-ins-tab-on-civil-3d.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+InfrastructureModelingDevblog+%28Infrastructure+Modeling+DevBlog+%29

Thursday, April 26, 2012

Draw Order Extended

In my last post, I mentioned that I have been working on modifying the Draw Order By Layer command found on the Autodesk Labs Plugin of the month page here. I think I have pretty much perfected it to the best of by ability and for what I wanted it to do.

First, I added additional tabs for other items needed to adjust draw order. The tabs added were XREFs, Blocks, Civil3D Surfaces, and a Checked Items Tab. Now, many of these items could have been moved to a separate layer and then adjusted via the basic Draw Order By Layer tab, but for many of these items, that goes against company standards. We typically put all of our XREFs on one XREF layer and Civil3D surfaces automatically go on one surface layer, so why not just allow for adjustment of these items? The blocks tab was added for me personally as many times I might have the same block on multiple layers and need to adjust accordingly for all instances, thus selecting the block name made sense. The checked items tab I think is the coolest, as it allows for you to work with all object on a selected layer (or multiple layers), XREF objects selected, and blocks selected - and if you think outside the box it will handle all Civil3D surfaces via the layer the surfaces go on. Trust me, I tried to incorporate Civil3D surfaces to this list as well, but Civil3D would crash hard when adjusting - and I'm not sure why.

Here is what the command looks like:








The best workflow I have found with the command is to begin by adjusting your surfaces in the order they should display. You'll see from the image examples below the existing surface was brought over the analysis surface. Once completed rerun the command and select the necessary layers (include the default surface layer), and/or XREFs, and/or Blocks, then go to the Selected Items tab and use the update button on the far left to generate the list of checked items. Re-order everything in the desired order from top to bottom (surfaces most likely at bottom) and you'll see in the last image everything has been updated.




--------------------------------------------------------------------------------------------------------------------------------------------------
AutoCAD Civil3D 2011 Version - as shown above
--------------------------------------------------------------------------------------------------------------------------------------------------
Zip File
If you are interested in the Zip file for the actual code, you can download from here.

DLL File
If you are interested in the dll file for the plugin command, you can download from here. Then run the NETLOAD command in Civil3D and select the file. The command will runs with the command DOEXT.
--------------------------------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------
AutoCAD 2011 Version - minus the Surfaces tab shown above
--------------------------------------------------------------------------------------------------------------------------------------------------
Zip File
If you are interested in the Zip file for the actual code, you can download from here.

DLL File
If you are interested in the dll file for the plugin command, you can download from here. Then run the NETLOAD command in Civil3D and select the file. The command will runs with the command DOEXT.
--------------------------------------------------------------------------------------------------------------------------------------------------