AutoCAD Script Error

AutoCAD Script Error

john_a_hobson
Observer Observer
716 Views
1 Reply
Message 1 of 2

AutoCAD Script Error

john_a_hobson
Observer
Observer

Hi

 

I have created a faceted 3D sphere (a truncated Buckyball) and blocks to place in the centre of the facets. Rather nicely, when I orient the sphere, the blocks automatically orient themselves to lie flat on the selected facet. 

 

However when I record a script that places a block in the centre of a facet and then run the script, the block always centres on a vertex of the facet, not the centre. Can I correct this? I created the facets in the first place because if I place the block directly onto a vertex it does not orient nicely.

0 Likes
717 Views
1 Reply
Reply (1)
Message 2 of 2

hencoop
Advisor
Advisor

What running osnaps do you have active? (Use DDOSNAP to see them).  If you have any active just set them to none before your script and reset them after.

(SETQ curr-osmode (GETVAR "OSMODE")

(SETVAR "OSMODE" 0)

**** your script *****

(SETVAR "OSMODE" curr-osmode)

 

This should keep unwanted snap locations from being used.

 

Alternatively,  put "none" in your script just before the midpoint of the facet is provided.  This tells AutoCAD to snap to nothing from the point provided.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes