.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Osmode in c#

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
1339 Views, 9 Replies

Osmode in c#

I'm having some trouble setting the Osmode system variable. I'm trying to set it to 55 which gives me the snaps I normally use. I was able to figure out isnunits and several others but Osmode is eluding me. Any help would be appreciated.
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Anonymous

Have you been programming with .NET for long?

What sort of 'trouble' are you having with setting
a system variable?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5581424@discussion.autodesk.com...
I'm having some trouble setting the Osmode system variable. I'm trying to set it to 55 which gives me the snaps I normally use. I was able to figure out isnunits and several others but Osmode is eluding me. Any help would be appreciated.
Message 3 of 10
Anonymous
in reply to: Anonymous

db.Ltscale = (varltscale);
db.Dimscale = (factor);
db.Celtscale = 1;
db.Psltscale = false;
db.Insunits = Autodesk.AutoCAD.DatabaseServices.UnitsValue.Inches;

The above system variables are a little more obvoius, but Objectsnap seems to be a little more like "Insunits". With that said, I can set Objectsnap to "Tan" or "Int" or .... but I am having trouble setting Objectsnap to more than one of those items. When I set osmode at the command line I simple set it to 55 and I have what I want. The same does not seem to work in C#. To anwser your question I have used VBA, Active X, and good ole Lisp for quite some time, but realizing that the direction is moving towards .Net I am rewriting everything I have in .Net. FYI, that post that says Camron Diaz S&M carries a trojan horse with it.
Message 4 of 10
Anonymous
in reply to: Anonymous

If it helps here is where I am with some basic system variables that I normally set.

[CommandMethod("setdwgfac")]
public void setdwgfac(double factor)
{
Double adfltscale = 0.375;
Database db = HostApplicationServices.WorkingDatabase;
Transaction trans;
trans = db.TransactionManager.StartTransaction();
double varltscale;
varltscale = (factor * adfltscale);
db.Ltscale = (varltscale);
db.Dimscale = (factor);
db.Celtscale = 1;
db.Psltscale = false;
db.Insunits = Autodesk.AutoCAD.DatabaseServices.UnitsValue.Inches;
db.Dimasz = 0.125;
db.Lunits = 4;
db.Luprec = 6;
trans.Commit();
trans.Dispose();

}
Message 5 of 10
Anonymous
in reply to: Anonymous

I Found what I need, though I could have used some sort of answer instead of a question about my expreience.
Message 6 of 10
Anonymous
in reply to: Anonymous

>> I Found what I need, though I could have used
>> some sort of answer instead of a question about
>> my expreience.

Your experience level determines how the question
is answered.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5582211@discussion.autodesk.com...
Message 7 of 10
Anonymous
in reply to: Anonymous

ConsultantERP,
It's great that the issue is resolved for you.
Did you consider posting the solution so that anyone searching in the future
will find an answer.

/// kwb

wrote in message news:5582211@discussion.autodesk.com...
I Found what I need, though I could have used some sort of answer instead of
a question about my expreience.
Message 8 of 10
Anonymous
in reply to: Anonymous

It is not obvious to me that I was handling this completely wrong. Here is what I ended up with. FYI, I try to keep my screen as uncluttered as possible, hence the long modemacro string.

Double adfltscale = 0.375;
Database db = HostApplicationServices.WorkingDatabase;
Transaction trans;
trans = db.TransactionManager.StartTransaction();
double varltscale;
varltscale = (factor * adfltscale);
acadapp.SetSystemVariable("ltscale", varltscale);
acadapp.SetSystemVariable("Dimscale", factor);
acadapp.SetSystemVariable("Celtscale", 1);
acadapp.SetSystemVariable("Psltscale", 0);
acadapp.SetSystemVariable("Insunits", 1);
acadapp.SetSystemVariable("Dimasz", 0.125);
acadapp.SetSystemVariable("Lunits", 4);
acadapp.SetSystemVariable("Luprec", 6);
acadapp.SetSystemVariable("ModeMacro", "LTSCALE:$(GETVAR, LTSCALE) DIMSCALE:$(GETVAR, DIMSCALE) ARROW SIZE:$(GETVAR, DIMASZ) SCALE:$(rtos, $(/, 12, $(/, $(GETVAR, LTSCALE), .375))) TEXTSIZE:$(GETVAR, TEXTSIZE) DIMSTYLE:$(GETVAR, DIMSTYLE) LAYER: $(GETVAR, clayer) |");
trans.Commit();
trans.Dispose();
Message 9 of 10
Anonymous
in reply to: Anonymous

oops, I ment to say "It is NOW obvoius I was .....
Message 10 of 10
Anonymous
in reply to: Anonymous

Also I omitted an item in the previous code segment

using acadapp = Autodesk.AutoCAD.ApplicationServices.Application;

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost