Thursday, April 27, 2023

XREFs on Layer

Over the years supporting AutoCAD/Civil 3D, I have been asked, where are my XREFs?  Co-workers have placed the references on the current layers and turned off that layer. I wrote a simple lisp routine that will place the reference on a specified called "G-ANNO-REFR" which can be changed to your company standards.

The lisp routine uses the "XA" command (which can be changed to your likings). XA is a default command for XATTACH. Once the lisp routine is set in the CUI startup, it will override the default "XA" command. Run the XA command to attach a drawing. Once the drawing is attached, the previous layer will be restored.


Items in red can be changed per user preference.

;SETS LAYER G-ANNO-REFR CURRENT BEFORE
;ATTACHING A DRAWING
;
;
(defun C:xa ()
   (command "layerpmode")
   (command "on")
   (command "-layer")
   (command "m")
   (command "G-ANNO-REFR")
   (command "")
   (initdia) (command "_XATTACH")

   (command "_layerp")
  
   (princ)
)



Cleanup the "Temp" folder!

Over time, the c:\Users\%USERNAME%\AppData\Local\Temp\ folder will collect Gigs and Gigs of files from software. It's best to clean it from time to time but make sure there is not anything useful in this folder before deleting. Once it's gone, it's gone. I am not responsible for anything that is deleted. You can navigate to the folder to manually delete the files and folders or create a batch file to delete the files and folder with just double click. I execute the file about once a month to clean the Temp folder.

Here are the steps to create the batch file.

  1. Open Notepad.
  2. Copy and paste the script below into the blank Notepad file.
  3. Click File then SaveAs.
  4. Click the "Save as type" pull down to select All Files. This will allow the Notepad file to have another file extension type.
  5. Name the file to your preference with a .bat extension. I named the file "Delete User Temp Files.bat".
  6. Execute the batch file. You'll see Command Prompt screen appear as it's deleting the files and folders. It will not delete files and folders that are currently being utilized by the OS or open software.

rem This batch file deletes files

rem and folders in the User Temp folder

cd\

c:

cd c:\Users\%USERNAME%\AppData\Local\Temp\

del /s /q c:\Users\%USERNAME%\AppData\Local\Temp\

rmdir /s /q c:\Users\%USERNAME%\AppData\Local\Temp\

cd\





Tuesday, April 18, 2023

Renaming/Renumbering Civil 3D Alignment Curve Segments

When updating an alignment with new curves or replacing curves, the curve segment name/numbers will be out of order. The curve name/numbers will display also display out of order in the Superelevation Tabular Editor. To rename/renumber the curves, follow the steps below.

  1. Select the corridor.
  2. Click the Superelevation pull down on the Ribbon.
  3. Click Calculate/Edit Superelevation.
  4. Click into the Curve Name field to rename the curve.
  5. Close the Manager.
  6. Open the Superelevation Tabular Editor to view the updated curves.





Monday, April 10, 2023

360 Degree Animation

So, I created a shared use path in Civil 3D for a work project. The path has a bridge which I modeled in AutoCAD with solids. The bridge is just for show until our structural team designs the bridge. I created a 360 degree video using Twinmotion. My workflow is Civil 3D/AutoCAD > Infraworks > 3DS Max > Twinmotion. I had to add metadata to the video using a metadata injector in order for YouTube see the 360 video. The 360 degree video can be viewed on a PC, smartphone, VR headset and a VR Google cardboard type. This process in Twinmotion can be very time consuming. The video took about eight hours to process. Below are my current PC hardware specs.

ASUS ROG B550 Motherboard.
AMD Ryzen 9 3950X 16-Core, 32-Thread CPU.
64 Gigs of DDR4 RAM.
NVIDIA GTX 3090Ti Founders Edition GPU.
ASUS ROG STRIX 1000G PSU.


Play the below video and use the mouse to pan around. If you are using a smartphone, rotate the phone to look around.


Wednesday, April 5, 2023

Autodesk Civil 3D 2024

I'm testing the new features in Civil 3D 2024. Looks good so far.


Thursday, December 15, 2022

3D Scene & Gaming Assets

Modeling scene and game assets in AutoCAD is very simple. Take My Autodesk University course 3D Modeling with the Best: AutoCAD to learn the basics of 3D modeling in AutoCAD.

In this quick tutorial, you will draw a 3D bottle as show below using a series of circles and ellipses.


    1.       Set the Workspace to 3D Modeling.

    2.       Create layers Bottle, Bottle-Cap and Guidelines.

    3.       Set System Variable DELOBJ to 0. This will retain the guideline objects when creating 3D objects.

    4.       Set the Guidelines layer current.

    5.       Turn on Ortho (F8).

    6.       Draw an Ellipse with a Center axis endpoint at 0,0,0.

    7.       Type a distance of 1 in the X Plane.

    8.       Type a distance of 0.5 in the Y Plane.

    9.       Change the UCS Z-Axis Vector along the Y Axis direction.

    10.   Set the View to Front.

    11.  Draw a centerline polyline (shown in red) from the center of the ellipse with a length of 6.25.

    12.   Draw a reference polyline (shown in blue) using Arcs to set the outer shape of the bottle.

    13.   Draw a series of polylines snapping to the endpoints and midpoints of the arcs drawn in step 8 perpendicular to the centerline polyline.

  


 

    14.   Set the view to SW Isometric.

    15.   Copy the ellipse from the center point to the endpoint of each line drawn in step 9.



    16.   Copy the bottom ellipse upwards a distance of 0.05 and another at a distance of 0.01.

    17.   Adjust the Major and Minor Radius of the two newly created ellipse to be smaller than the original ellipse.

 



    18.   Change the UCS to World.

    19.   Draw a circle just above the top ellipse.

    20.   Copy the newly created circle upwards along the Z-Axis with a distance of 0.4.

  


    21.   Click the Surface tab on the ribbon.

    22.   Set the Bottle layer current.

    23.   Click Loft.

    24.   Select the ellipses in order #1 through #10.

    25.   Click Loft.

    26.   Select circles in order #10 through #11.

    27.   Change the UCS Z-Axis Vector along the Y Axis direction.

    28.   Draw a half section of the cap (shown above in green) with a closed polyline.

    29.   Revolve the cap half section around the centerline of the bottle 360 degrees.

 

Finished 3D model. The model can be referenced/imported into the 3DS Max, Maya and other 3D software for rendering and texturing.









Thursday, December 8, 2022

Autodesk Civil 3D Miscellaneous Files

Overtime, Civil 3D will leave various files in the project folder. I’ve created a list of files with descriptions that can be deleted to clean up the project folder.

 

*.dwl (Drawing lock) (File left when the drawing crashes)

*.dwl2 (Drawing lock) (File left when the drawing crashes)

The drawing lock files are hidden so the Show Hidden files and folders will need to be enabled. If the drawing lock file is currently in use, it cannot be deleted.

Acad.err (Drawing error logs) (File left when the drawing crashes)

Plot.log (Drawing plot logs)

Be sure Plot.log files are not needed for plot expenses.

hardcopy.log (Drawing plot error logs)

sav*.tmp (Drawing temp file) (File left when the drawing crashes)

*recover.dwg (Drawing recover files)

Be sure the recover file is no longer needed before deleting it.

*.adt (Drawing Audit Report log file)

*.bak (I usually delete or rename the BAK file after renaming a sheet through Sheet Set Manager.)