Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

CHSPACE command altering the Z-values of objects to -#.##e99

hencoop
Advisor

CHSPACE command altering the Z-values of objects to -#.##e99

hencoop
Advisor
Advisor

The CHSPACE command is jacking up Z-values of objects.  If they are MULTILEADERs, the Z-values CANNOT be fully reset to 0.0 using the CHANGE command, Autolisp, or Visual Lisp.  There is at least one unreachable Z-value that is untouched.  It can be seen using the LIST command on the MULTILEADER (the ASSOC 10, 12, 110 values have Z=0.0).

MULTILEADER Layer: "C-VI046NOTE" Space: Model space Handle = 6e0d Leader Type: StraightLeader Content Type: MTextContent 
Landing: ON Leader Number: 0
Vertex: X = 1643382.1137, Y = 581080.0480, Z = 0.0000 
Vertex: X = 1643392.4306, Y = 581103.7736, Z = -6.3281E+99
Multileader style: STandard Annotative: NO

 

I exploded one of these problem MULTILEADERs which had spline leaders (to recreate it from the text) and the splines disappeared; however, after saving the drawing, closing it, the drawing immediately crashed upon reopening.  I ran RECOVER on it and that found the splines which had to be deleted to fix the drawing.

 

Any ideas why CHSPACE is screwing the Z-values?

 

Recover.jpg

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 Me gusta
Responder
Soluciones aceptadas (1)
2.031 Vistas
21 Respuestas
Respuestas (21)

Patchy
Mentor
Mentor

It has the same value as BACKZ, but it's read only and no one knows why it happens or how to fix it.

Only happened with Land Desktop and C3D.

 

Who knows why 1.JPGWho knows why.JPG

 

 

0 Me gusta

hencoop
Advisor
Advisor

My drawing shows BACKZ = 0.0000 (read only)

 

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 Me gusta

hencoop
Advisor
Advisor

I checked all of the System Variables and these are the only two that have large Z-values:

EXTMAX 34.0005,22.0003,xxx-xxxxxxxx.0000 (read only)
EXTMIN -0.0005,-0.0003,-1.5258E+15 (read only)

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 Me gusta

Patchy
Mentor
Mentor

Activate the viewport then use command BACKZ

0 Me gusta

hencoop
Advisor
Advisor

There it is!

BACKZ = 6.3281E+99 (read only)

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 Me gusta

cadffm
Consultant
Consultant

The formula is  Z of your object * Viewportscale = New Z in paperspace.

 

 

Sebastian

0 Me gusta

hencoop
Advisor
Advisor

I rechecked the System Variables with the viewport activated.  The Z-value of the TARGET seems to be the source of my problems.

These were the prior values (idk why my previous reply x'd out the EXTMAX Z-value numbers):
EXTMAX            34.0005,22.0003,xxx-xxxxxxxx.0000     (read only)
EXTMIN            -0.0005,-0.0003,-1.5258E+15          (read only)

Viewport Activated:
EXTMAX            3.4191E+99,585628.2073,942.0457      (read only)
EXTMIN            -1.7315E+84,-5.3249E+99,-1.2656E+99  (read only)
TARGET            1643490.8475,581068.6715,-6.3281E+99 (read only)

 

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 Me gusta

hencoop
Advisor
Advisor

The Z-value of the objects are all 0.0000

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 Me gusta

Patchy
Mentor
Mentor

It doesn't matter what viewport scale, it will inherit the BACKZ value when chspace is used.

Here is the dwg, you can give it a test.

 

cadffm
Consultant
Consultant

@Patchy  In case the objetcs are not at 0 (isn't the case here in this thread)- you are wrong.

Sebastian

0 Me gusta

hencoop
Advisor
Advisor

Something is really screwed in this drawing.

I tried to reset everything by setting PLAN to WORLD and then using the DVIEW command to reset the twist and ZOOM to reset the scale.  The magnification height would not reset from 7.1997E+99 using ZOOM 1/50XP or entering a magnification height of 1000.  It looks like the only cure for this will be to WBLOCK Mspace and Pspace and then open the Mspace wblocked drawing and insert the Pspace wblocked drawing into its layout and explode it.  This should create a new drawing header and leave out the corruption that is causing this... we'll see.

Command: (setq itc (getvar "viewctr"))
(1.64351e+06 581049.0 0.0)

Command: (setq vangl (getvar "viewtwist"))
0.0601247

Command: PLAN

Enter an option [Current ucs/Ucs/World] <Current>: w
Regenerating model.

Command: (SETVAR "viewtwst" vangl)

ERROR: AutoCAD variable setting rejected: "viewtwst" 0.0601247; reset after error

Command: VIEWTWIST

VIEWTWIST = 0.00000000 (read only)
Command: (* 180.0 (/ vangl PI))
3.44489

Command: (* 180.0 (/ vangl PI))*Cancel*

Command: *Cancel*

Command: VIEWTWIST

VIEWTWIST = 0.00000000 (read only)
Command: DVIEW

Select objects or <use DVIEWBLOCK>:

Enter option
[CAmera/TArget/Distance/POints/PAn/Zoom/TWist/CLip/Hide/Off/Undo]: tw

Specify view twist angle <0.00>: (* 180.0 (/ vangl PI))
3.44489

Enter option
[CAmera/TArget/Distance/POints/PAn/Zoom/TWist/CLip/Hide/Off/Undo]:
Regenerating model.

Command: Z
ZOOM
Specify corner of window, enter a scale factor (nX or nXP), or
[All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: c

Specify center point: !itc
(1.64351e+06 581049.0 0.0)

Enter magnification or height <7.1997E+99>: 1000
Regenerating model.

Command:
ZOOM

Specify corner of window, enter a scale factor (nX or nXP), or
[All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: *Cancel*

Command: *Cancel*

Command: Z
ZOOM
Specify corner of window, enter a scale factor (nX or nXP), or
[All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: 1/50xp
Regenerating model.

   

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 Me gusta

hencoop
Advisor
Advisor

Not wrong, just misunderstood.

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 Me gusta

cadffm
Consultant
Consultant

@hencoop 

then you found it, target not perpendicular to object plane,

this way your statement "all at Z=0" is right, if you talking about WCS or UCS,

but the data isn't "all at Z=0" messured from the view plane.

 

Next time, upload a sample dwg - it's much better for other users and a (shorter) discussion :cara_con_una_leve_sonrisa:

Sebastian

0 Me gusta

hencoop
Advisor
Advisor

@Patchy , @cadffm 

I recreated the drawing using WBLOCK as described in my prior reply.  Now, all is is good!  Something CHSPACE jacked up the drawing!  

 

New drawing results:

    Command: MS
    MSPACE
    Command: TARGET
    TARGET = 1642771.3801,583175.9174,341.5070 (read only)
    Command: BACKZ
    BACKZ = 0.0000 (read only)

 

New drawing results with no other edits except one use of CHSPACE!

    Command: CHSPACE

    Select objects: 1 found

    Select objects:
    Set the SOURCE viewport active and press ENTER to continue.:
    1 object(s) changed from MODEL space to PAPER space.
    Objects were scaled by a factor of 0.02 to maintain visual appearance.

    Command: Specify opposite corner or [Fence/WPolygon/CPolygon]:
    Command: MS
    MSPACE
    Command: BACKZ

    BACKZ = 6.3281E+99 (read only)
    Command: TARGET

    TARGET = 1643490.8475,581068.6715,-6.3281E+99 (read only)

:cara_sonrojada:

 

My solution?  NEVER USE CHSPACE AGAIN! No, wait!  I need to replace the viewports with new ones and see if it is a viewport corruption problem!

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 Me gusta

hencoop
Advisor
Advisor

@cadffm Maybe I don't understand you?  

I am using WORLD coordinates; I have used the command PLAN and set the viewport to WORLD;  Using DVIEW to check the target I see the angle from the XY plane is -90, and, the angle in the XY plane from the X axis is -90, The system variable AUPREC=8

 

I have just proven to my satisfaction that the cause of this problem is the DVIEW command.  Specifically, the following will jack up/down the values of TARGET and BACKZ:

(COMMAND "._dview" "" "tw" 3.44489 "").  I have a routine that calculates the desired angle and feeds it as a variable name instead of 3.44489 (or 3.444889250415612, the calc'd value to 16 places)

I tested this, it makes no difference whether each individual entry is manually keyed in at the command line or entered by an autolisp function as shown (whether angle is rounded to 4-places or not rounded at all).

 

What is [wrong with/designed into] DVIEW TWIST that it jacks the TARGET and BACKZ system variables?

 

Apparently, I cannot twist my viewport to this angle (and likely many other angles) without jacking TARGET and BACKZ and causing these jacked values to be assigned to objects operated on by CHSPACE.

 

Am I using DVIEW TWIST incorrectly?

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 Me gusta

hencoop
Advisor
Advisor

@cadffm@Patchy 

It seems that this problem may be caused by DVIEW TArget and CAmera points being very close together in Z-value.  (I still don't know what cause that).  Trying to set them coincident to test failed as AutoCAD does not allow them to be coincident... so I set them very close to each other but that did not cause DVIEW TWist to recreate the problem.  Nevertheless, there were similarities between this problem and another I had some while back:

https://forums.autodesk.com/t5/civil-3d-forum/cannot-select-3d-lines/m-p/6223167#M297306 

I've modified my code to set both FRONTZ and BACKZ, turn off clipping, and reset TARGET Z-values (POints option sets this) before my DVIEW TWist command.  That seems to have solved my problem... so far.

Summary:  DVIEW TWist sometimes changes the TARGET and/or BACKZ Z-values to huge or minuscule numbers (#.#e+99).  It seems especially so if they are already not zero.  Resetting FRONTZ, BACKZ,  turning OFF DVIEW CLipping and resetting the TARGET (POints option) before executing DVIEW TWist keeps these Z-values from being jacked... so far.

;Use (GETVAR "VIEWCTR") to keep the view in the same place after DVIEW 
(COMMAND "._DVIEW" "" "CL" "B" "0.0" "CL" "F" "0.0" "CL" "OFF" "PO" (LIST (CAR (GETVAR "VIEWCTR"))(CADR(GETVAR "VIEWCTR"))0.0) (LIST (CAR (GETVAR "VIEWCTR"))(CADR(GETVAR "VIEWCTR"))1.0) "TW" vwang "")

 

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 Me gusta

hencoop
Advisor
Advisor
Solución aceptada

@Patchy @cadffm  So, today my fix was failing because AutoCAD saw TARGET and CAMERA POints as coincident.    I was trying to set them to the VIEWCTR X,Y and give them differing Zs.  It appears that their existing Z-values  being minuscule/enormous are responsible for this error in AutoCAD.  The fix is as follows:

 

To be very clear, all of these DVIEW things must be done before using CHSPACE whenever my viewport's TARGET is not well behaved , i.e. When TARGET has a minuscule/enormous Z-value like -6.385E+99.

Once TARGET is 0,0,0, BACKZ=0.0, and FRONTZ=0.0 using CHSPACE does NOT jack the Z-values of the objects!

 

This is what was happening (Text Window command history):

 

 

Command: DVIEW

Select objects or <use DVIEWBLOCK>:

Enter option
[CAmera/TArget/Distance/POints/PAn/Zoom/TWist/CLip/Hide/Off/Undo]: PO

Specify target point <1643253.5316, 583856.1333, -4.6094E+99>: (LIST(CAR(GETVAR "VIEWCTR"))(CADR(GETVAR "VIEWCTR"))0.0)
(1.64325e+06 583856.0 0.0)

Specify camera point <1643253.5316, 583856.1333, -4.6094E+99>: (LIST(CAR(GETVAR "VIEWCTR"))(CADR(GETVAR "VIEWCTR"))1.0)
(1.64325e+06 583856.0 1.0)

Camera and Target may not be coincident

 

 

 

Here is what I had to do to make it all work for me:

It was necessary to separate the CLipping part of the command from the POints and TWist parts; then, set the TARGET and CAMERA POints to 0,0,0 and 0,0,1 respectively to avoid the coincident error that AutoCAD is reporting; then, set the TWist angle; finally, ZOOM Center using the saved VIEWCTR point.  This works for me... so far.  the results are BACKZ=0.0; FRONTZ=0.0; TARGET= #.###, #.###, 0.0 (and VIEWCTR as I need it):símbolo_del_pulgar_hacia_arriba:

I.e.

 

 

 

      (SETQ vwctr (LIST (CAR (GETVAR "VIEWCTR"))(CADR (GETVAR "VIEWCTR")) 0.0))
      (COMMAND "._DVIEW" "" "CL" "B" "0.0" "CL" "F" "0.0" "CL" "OFF" "")
      (COMMAND "._DVIEW" "" "PO" "0,0,0" "0,0,1" "")
      (COMMAND "._DVIEW" "" "TW" vwang "")
      (COMMAND "._ZOOM" "C" vwctr "")

 

 

P.S. The above code is a part of my tool for setting any VIEWTWIST required in my viewport.  It seemed like the most logical place to force these SYSVAR resets.

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

Patchy
Mentor
Mentor

Strange that it happened only with Civil drawings.

0 Me gusta

cadffm
Consultant
Consultant

:cara_pensativa:

Sebastian

0 Me gusta