Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OSNAPZ=1

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
mcloughlin
11499 Views, 10 Replies

OSNAPZ=1

 

We are a survey company that spends most drawing time connecting COGO points with linework at Z=0 (flat planar drawings for finished plats).  This requires that we set OSNAPZ to 1.  

 

In Civil 3D 2014, we've found that if 1) we start a new drawing, or 2) we close and then open an existing drawing, we find that OSNAPZ has reverted to 0, so that new linework comes in at all sorts of nonsensical elevations and must be edited.  

 

I'm sure there's a way to set the template to retain the setting OSNAPZ=1, in order that whenever new or existing drawings are opened we can begin work without having to re-set this variable every time.  

 

How do we do this?  

 

Thanks for the help.  

 

 

10 REPLIES 10
Message 2 of 11
jmayo-EE
in reply to: mcloughlin

Message 3 of 11
rl_jackson
in reply to: mcloughlin

The only way you can do this would be to make a .LSP that is loaded as part of the APPLOAD function. Unfortunately you still going to run into hiccups with it reverting back to 0 on occasion. It's very annoying

There's also the option of going with 3rd party, Sincpac has a button which makes setting it a little easier

Rick Jackson
Survey CAD Technician VI

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 4 of 11
jmayo-EE
in reply to: mcloughlin

This macro can be placed in a toolbar button or ribbon button

 

 (setvar "OSNAPZ" (if (= (getvar "OSNAPZ") 1)0 1)).

John Mayo

EESignature

Message 5 of 11
jmayo-EE
in reply to: jmayo-EE

Nothing against Sincpac. I highly recommend it! It may help you save your hair and/or marbles. 😉

John Mayo

EESignature

Message 6 of 11
mcloughlin
in reply to: jmayo-EE

 

Thanks for the reference, which thus far has not proved helpful.  The poster stated:

 

"For the record, I created acaddoc.lsp which contained
(setvar "osnapz" 1) 
in my C:\Program Files\AutoCAD Civil 3D 2010\Support folder."

 

Tried this, but the file doesn't run, i.e., doesn't change the osnapz setting.  Likely I am missing some code, not being a LISP expert.  Is there a way around this?

 

 

Message 7 of 11
jmayo-EE
in reply to: mcloughlin

Go to the options dialog, files tab and note the support path at top of the list. This is the folder acad will search first for acaddoc.lsp. This is the controlling folder. Pop the acaddoc.lsp in here.  Restart Acad and it should run.

 

Excerpt from my acaddoc.lsp. All of these variables get reset with every file I open.

 

(defun-q S::STARTUP ()
(princ "Changing VIEWRES...")
(command "VIEWRES" "Y" 12500)
)
(setvar "SAVETIME" 10)
(setvar "pickadd" 2)
(setvar "pickfirst" 1)
(setvar "PeditAccept" 1)
(setvar "mirrtext" 0)
(setvar "plinegen" 1)
(setvar "filedia" 1)
(setvar "cmddia" 1)
(setvar "pellipse" 1)
(setvar "plinetype" 2)
(setvar "ISAVEBAK" 1)
(setvar "GeoMarkerVisibility" 0)
(setvar "GripsMultifunctional" 1)
(setvar "SelectionAnnoDisplay" 0)
(setvar "HPQuickPreview" Off)
(command "-plotstamp" "0")

John Mayo

EESignature

Message 8 of 11
rl_jackson
in reply to: jmayo-EE

Nice one John, I really like the filedia 1 - cant count how may times I have to type that when something gets jacked up in C3D

Rick Jackson
Survey CAD Technician VI

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 9 of 11
jmayo-EE
in reply to: rl_jackson

Just passing along what I have learned here. 😉

 

HTH

John Mayo

EESignature

Message 10 of 11
neilyj666
in reply to: jmayo-EE

Include the line below in acaddoc.lsp

 

(setvar "MODEMACRO" "OSNAPZ = $(getvar, osnapz)")

 

to get this to show all the time so you know what the setting is

 

Modemacro.jpg

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2024 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
Message 11 of 11
bcollins
in reply to: mcloughlin

I'm also a surveyor who works for an engineering firm and I approached the solution a little differently.  I'm ok with lsp routines but not great.  So if I can find a solution to an issue that doesn't involve using one then that's the route that I'd prefer to take.  I opened my drawing template, went to toolspace -> settings tab -> point -> point styles.  Right click on the name of one of your styles and hit "edit".  In the box that opens up, click on the 3D geometry tab and next to the "Point Display Mode", select "Flatten Points to Elevation" and then next to "Point Elevation", set the elevation to 0.

 

That has worked like a champ for us.  You'll need to do this same step for each of your Point Styles, but as long as you make the change in your template then you'll only have to do it once (other than existing drawings of course).  I was nervous that it would mess with our surfaces if we flattened everything to 0, but so far we haven't seen any ill effects from it.  It doesn't change the elevation of your point to 0 - just draws the point marker at that elevation.  This is also something that you can change DURING the process of your project.  If you need your points at their elevations instead of 0 then just go back and change the point style from "Flatten Points to Elevation" to "Use Point Elevation".  You don't have to reimport the points or anything like that.  All you're really changing is the elevation of the point marker.

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

Post to forums  

Rail Community


Autodesk Design & Make Report