Ad

Monday, March 21, 2022

Demo Palette Commands

Some code to help in doing my demos. It goes into the Tool Palette as commands and then I can press the command in the Tool Palette to run the command. 

This does a Save As file: 

^C^C(vla-saveas (vla-get-ActiveDocument (vlax-get-Acad-Object)) "C:/Civil 3D Projects/DFWBIUG_Test_A/Sewer/Phase 2/A_Phase1_Sewer_B_Street_Start.dwg");

Note:

  • The backslashes in the drawing path are forward slashes. 
  • The ^C^C clears the command line. 

This opens a file:

^C^C(LM:open "C:/Civil 3D Projects/DFWBIUG_Test_C/SampleCreateDS.dwg"); 

The tool palettes also work as an agenda so I can remind myself what I'm doing next.

The LM:open is modified from Lee Mac: http://lee-mac.com/open.html with totally different code.

Monday, May 17, 2021

SHOWLAYERUSAGE

 There appears to be a setting in AutoCAD that will prevent layers from indicating if objects are on them or not. The system variable is SHOWLAYERUSAGE. A value of 0 turns of the ability of AutoCAD to show if objects are on a layer. A value of 1 enables the ability of AutoCAD to indicate if a layer is in use. 

It appears this variable was created to improve drawing performance. In Civil 3D the value defaults to 0, or OFF. So if you want to see layer usage then you will want to set the value to 1. Not sure how badly this affects drawing performance. It sure would be nice if Autodesk created another thread to do the work instead of having it on the UI thread that makes the drawing performance go down. 

I guess if you hear an Autodesk developer say they can't think of a reason why multithreading is necessary, you can point them to this workaround they did instead of utilizing multithreading.

Coordinate System - Status Bar

 It would be useful to show the coordinate system in the status bar. 

One way to accomplish the task is to use the Map command MAPSTATUSBAR and set the value to SHOW. 


This, unfortunately, adds a bunch of other junk that is most likely not wanted, especially when using a small monitor. 

Another way to accomplish the task is to add the information using ModeMacro. This allows you to populate a box on the StatusBar with information. To do so in LISP, you could copy and paste this line to the command line: 

(setvar "MODEMACRO" (getvar "CGEOCS"))

 This will get the current coordinate system string and add it to the ModeMacro field. 

To clear the value you can use the following line that will remove the coordinate system:

(setvar "MODEMACRO" "")

You can then expand the concept with more advanced code that tracks when the coordinate system changes, using PointMonitor. 

This blog post has an example of using the PointMonitor: 

    https://www.tek1.com.au/point-monitor-hello-world-autocad-net-api/ 

To get and set variables you can use the following code: 

var coordCode = Application.GetSystemVariable("CGEOCS");

Application.SetSystemVariable("MODEMACRO" coordCode);

Friday, February 26, 2021

Cleaning a Maytag MHW5630HW2 Drain Pump Filter

I couldn’t find the instructions on how to clean out the Maytag MHW5630HW2’s drain pump filter. Most videos covered other manuals that required removing the front cover, taking off the back cover, or some combination of the two. 

There is a different way to accomplish the task. 

1. Unplug the power and turn off the water. 

2. Pull out the washer to a location where you can lean the washer up so you can gain access to the big hole that resides at the bottom of the washer. 

 


3. Pull out the four pins that hold the baseplate that holds the drain pump. The pins are number 19 in the image below. The grommets are number 19 and the drain pump filter is items 13 to 15. 

 


4. Detach the two electrical connectors on either side of the drain pump. 

5. Pull them out from under the washer enough to gain access to the black drain pipe and then unplug item 18 from it and have it drain into a vessel that can contain all of the water. In my case, I had to replug the black drain pipe twice to empty my vessel. 

6. After the water stops coming out of the black drain pipe, place the plug back in. 

7. Twist the drain pump filter, item 13, to open it up. Be careful because even more water will come out. Make sure to have your vessel ready to capture the water. 

8. Clean the drain pump filter and remove any objects obstructing it. In my case, there was some fabric that made its way down. 

9. To reassemble the removed parts, I found the best way was to remove the grommets from the base plate holding the drain pump at the front of the washer.

10. Then place the two grommets into the holes at the front of the washer. 

11. Place the two pins into the grommets at the front of the washer. 

12. Push the base plate with the drain pump into the grommets. It should slide right in. 

13. Position the two grommets that are still on the base plate into the two holes furthest away from the front of the washer. 

14. Add the pins to the grommets to secure the base plate to the washer. 

15. Put the washer back on the ground. 

16. Push the washer back into place and then turn back on the water and plug the power cord back into the electrical outlet. 

Screenshots taken from Appliance Parts Pros, I have no idea where they got their images and they did not sponsor this blog post.


Wednesday, February 03, 2021

Offset 3D Polyline VBA

Here is how I would offset a 3D Polyline for Civil 3D purposes. It's a bit different than for mechanical because civil engineering works in 2-1/2 D. 

The first step is to collect all of the 3D Vertices. this forum post has an example: https://forums.autodesk.com/t5/civil-3d-forum/get-polyline-coordinates-in-vba/td-p/2451913

Then create a polyline from the 3D Vertices and offset the polyline. The help file has some good code for that: https://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-80D106A9-A16F-4F32-BDE2-5C5B1F7C2C84

Then collect the polyline vertices and create a new 3D Polyline assigning the appropriate elevation to the vertices. Here is a link to the help file for that: https://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-21D7283A-552F-4DD8-BB4D-AEA1632186B9


LinkWithin

Blog Widget by LinkWithin

Ad