LDCad Aligning parts using rotation scripts


RE: Aligning parts using rotation scripts
#3
Rotate one part script approach

The customer rotation scripts provide an equivalent solution for rotating a part. The scripts are accessible via the Scripts/align parts menu item (see this post for installation instructions).

The first step with the alignment functionality is to identify the rotation axis. This is achieved via the menu item Scripts/align parts/Rotation Parameters (see Figure 6). The rotation axis will default to the Y axis, so if the axis around which to rotate to align the parts is either the X or Z axis, the alignment scripts must be notified.

In Figure 6 the parts need to be rotated around the Z axis, hence the Rotation Parameter macro is run. Once selected, the axis of rotation will remain the same until the macro is re-run and a different axis of rotation selected.

[Image: 06_single_new_01.png]
Figure 6 – Rotation Axis Selection

In Figure 6, the supplementary pins which are visible in Figure 3 can be seen. They are coloured red to make it easier to distinguish them from the parts/sub-files which are really part of the model.

To use the single part rotation script, the relevant four parts need to be selected in the order as illustrated in Figure 1. Figure 7 illustrates the four parts (the three supplementary pins and the sub-file which contains the leg) selected in readiness to run the script.

[Image: 07_single_new_02.png]
Figure 7 – Single Part Rotation Part Selection

Once the parts have been selected, the open scripts/align parts menu (Figure 8) and then select the Rotate one part menu item. If any number other than four parts have been selected, a dialog window will appear that prompts with the part selection requirements to run the script.

[Image: 08_single_new_03.png]
Figure 8 – Align Parts Menu

After the script has been run, the parts will be rotated and a dialog displayed that allows the rotation to be accepted or discarded (Figure 9).

[Image: 09_single_new_04.png]
Figure 9 – Rotate One Part Dialog

Closing the dialog by clicking Yes results in the rotation being applied to the model (Figure 10). At this point, the user should manually delete any supplementary parts being used purely to achieve the desired rotation.

[Image: 10_single_new_05.png]
Figure 10 – Model after One Part Rotation

By itself, the Rotate one part script is not much different to using the approach described earlier in the Existing LDCad Approach section. The primary difference is not having to establish and specify the rotation angle. However, the code used to rotate one part is available for re-use when attempting to align two rotating parts.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
RE: Aligning parts using rotation scripts - by David Manley - 2021-12-16, 8:38

Forum Jump:


Users browsing this thread: 5 Guest(s)