| Author |
Message |
peterpeter
Joined: 29 Jul 2005
Posts: 7
|
Posted:
Thu Feb 08, 2007 7:56 pm Post subject:
setting OSNAP with VBA |
|
|
Hallo AutoCad Goeroes out there,
Does anyone know how to set the OSNAP system variabele via VBA?
At a given point i want to change the OSNAP Settings.
Let's say by example from "int, end, mid" to "Near".
When I look to the property's I can't find a property to control the OSNAP settings.
What exists is the OSNAPMODE, but this turns the snap mode on or off.
Thank you
Peter Van der Velden
|
|
| Back to top |
|
 |
Fatty
Joined: 08 Jun 2006
Posts: 8
Location: Sankt-Petersburg, Russia
|
Posted:
Sat Feb 10, 2007 10:22 pm Post subject:
|
|
|
Hi Peter,
If I'd understand you correctly
Did you try to play with:
ThisDrawing.SetVariable "OSMODE", 512 ?
~'J'~ |
|
| Back to top |
|
 |
peterpeter
Joined: 29 Jul 2005
Posts: 7
|
Posted:
Mon Feb 12, 2007 9:30 am Post subject:
|
|
|
Hallo Fatty,
Thank You Very much.
This works fine.
I have searched the AutoCad help file and found the explenation of the bit OSNAP bitcodes.
Type: Integer
Saved in: Registry
Initial value: 4133
Sets running Object Snap modes using the following bitcodes:
0 NONe
1 ENDpoint
2 MIDpoint
4 CENter
8 NODe
16 QUAdrant
32 INTersection
64 INSertion
128 PERpendicular
256 TANgent
512 NEArest
1024 QUIck
2048 APParent Intersection
4096 EXTension
8192 PARallel
To specify more than one object snap, enter the sum of their values. For example, entering 3 specifies the Endpoint (bitcode 1) and Midpoint (bitcode 2) object snaps. Entering 16383 specifies all object snaps.
When object snaps are switched off using the Osnap button on the status bar, a bitcode of 16384 (0x4000) is returned, in addition to the normal value of OSMODE. With this additional value, developers can write applications for AutoCAD, and distinguish this mode from Object Snap modes that have been turned off from within the Drafting Settings dialog box. Setting this bit toggles running object snaps off. Setting OSMODE to a value with this bit off toggles running object snaps on.
Thank You
PeterPeter
|
|
| Back to top |
|
 |
Fatty
Joined: 08 Jun 2006
Posts: 8
Location: Sankt-Petersburg, Russia
|
Posted:
Mon Feb 12, 2007 3:17 pm Post subject:
|
|
|
Happy computing
Cheers
~'J'~ |
|
| Back to top |
|
 |
|
|
|
|