Changing Multileader Elevations to Zero

Changing Multileader Elevations to Zero

Anonymous
Not applicable
19,244 Views
22 Replies
Message 1 of 23

Changing Multileader Elevations to Zero

Anonymous
Not applicable

I'm working in Civil 3D 2019, and in my CAD dwg I have apparently drafted several multileaders that are at different elevations than the majority of the other drawing objects.  In the screenclip below, you'll see several multileaders in red at a much higher elevation and several multileaders in yellow at a much lower elevation.  I am trying to get these two sets of multileaders to zero elevation, and on the same plane (z coordinate) as the rest of my drawing.  The FLATTEN command doesn't work.  I've seen several past posts with solutions involving code, which is over my head.  Any help would be appreciated.  Many thanks in advance.

0 Likes
Accepted solutions (1)
19,245 Views
22 Replies
Replies (22)
Message 2 of 23

GrantsPirate
Mentor
Mentor

Go into a front view or right view, you can select all the ones on the same level, move, pick a displacement on one of the objects, use .xy filter, pick an object on the level you want, then just pull the cursor down and pick.  Repeat for the others.  If you only have this one drawing to do and there are only a couple of different elevations then it will go pretty quick.


GrantsPirate
Piping and Mech. Designer
EXPERT ELITE MEMBER
Always save a copy of the drawing before trying anything suggested here.
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.

Message 3 of 23

Anonymous
Not applicable

Thanks, but I don't know what you mean by pick a displacement on one of the objects, nor am I familiar with the .xy filter.

0 Likes
Message 4 of 23

GrantsPirate
Mentor
Mentor

X Y Z filters allow you to first specify only one location on a axis and then the others.  See video and also Help.

 

 


GrantsPirate
Piping and Mech. Designer
EXPERT ELITE MEMBER
Always save a copy of the drawing before trying anything suggested here.
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.

Message 5 of 23

StephenThomasGrace
Advocate
Advocate
Accepted solution

Here is a simple bit of code I have used.

Just drag it into you drawing window.

type "MLzero" to run it.

It does them all at once.

Note that they will not point to the original entity anymore so in essence they are disassociated. So any other view direction will look off... but hey, I always flatten stuff for the vanilla cad folks!

-steve

Message 6 of 23

Anonymous
Not applicable

Thanks!

0 Likes
Message 7 of 23

okozlovskii
Contributor
Contributor

Hello Steve,

 

You mentioned you have experience flattening cad files. Do you, by any chance, have an all-encompassing macro to flatten 3d CAD? I routinely have issues with linking consultant CADs to Revit. In short, the CAD's they provide are a complete mess. Elevation of lines jumps all over, annotations are placed on different elevations for no reason, etc.

 

I tried a bunch of commands (Flatten, Flatshot, etc), and CAD just shrugs them off most of the time. The only thing that seems to work is selecting objects by type with Q-select and change elevations, z-coordinates, z-elevations, and hundreds of other ways to set elevation in CAD, to zero. It takes a lot of time, and even that doesn't always work. For example, I had to use your macro to set multileaders to zero.

 

Thank you in advance. 

 

0 Likes
Message 8 of 23

StephenThomasGrace
Advocate
Advocate

No, Sorry.

I wish I did. Maybe I will create a routine in future.

Like you, I resort to all of the same things you are doing.

You need specific tools for some entity types, like 3dpolys... and FLATTEN used to duplicate blocks, so it is always a bunch of little workarounds.

Hang in there! Good cad folks, like yourself, that take the time to get all of the little stuff right are under appreciated.

cheers

-steve

0 Likes
Message 9 of 23

topknot
Participant
Participant

Why in the world won't Autodesk add elevation as a property to a multileader, to make this easy? This has been a problem for every civil 3d user I know, forever. 

Message 10 of 23

awhiteQ38RQ
Contributor
Contributor

You sir, are the man! 

Message 11 of 23

Anonymous
Not applicable

You are AWESOME, Thank You.

0 Likes
Message 12 of 23

dmarchant
Advocate
Advocate

opps

0 Likes
Message 13 of 23

dmarchant
Advocate
Advocate
Do you have a .lisp for Multileader with blocks Sir?
0 Likes
Message 14 of 23

StephenThomasGrace
Advocate
Advocate

Should work on Multileaders with blocks, too. Works on mine....

-steve

Message 15 of 23

dmarchant
Advocate
Advocate

Thank you for swift reply, i have a drawing that i cannot get it to work in, no rush but if you could take a look and let me know what has happened i'd really appricate it as its something i haven't come accross before and i really dislike a mystery, if not i completely understand as we are all busy people. Thank again.

btw the way before you repiled I opened a support case to try and solve this, just so i can get to bottom of probelm so it doesnt happen again. Once again thank you.

0 Likes
Message 16 of 23

dmarchant
Advocate
Advocate

I think the user this must have refranced in a drawing that wasnt flat and started multileader command on one x and placed block on another, but i am not sure its a mystery as we only use LT!

0 Likes
Message 17 of 23

StephenThomasGrace
Advocate
Advocate

Yes. Most of the multileaders are not coplanar.  So as you suspected, the previous person had som odd UCS in play when the mleaders were placed. Some of the blocks are flat (outlines show solid fill) whereas some are not. Notice the 0.2 wide polyline in the block displays as outline only in the blocks that are severely skewed from current view plane. Since most do not have any common elevation or skew, it would take longer for me to create a lisp file than it would to replace them all one at a time ... even if you could run lisp in LT. sorry.

Message 18 of 23

dmarchant
Advocate
Advocate

Not a problem Sir as of course your correct about replacing (i just hoped you had another existing routine is all as i didnt want you to write one) but thank you for Confirming My Suspicions on what had happened. Have a good day.

0 Likes
Message 19 of 23

hencoop
Advisor
Advisor

I tried that with some less elegant code  (I like your code).  My code does zero the Z-values but they are still listing as -6.3281E+99 afterwards even though the entity's association list shows Z = 0.0 for association #s 10,12 & 110

Here are both the object data and the entity association list:

 

 

 

Select object: ; IAcadMLeader: AutoCAD Multi-Leader Interface
; Property values:
;   Application (RO) = Exception occurred
;   ArrowheadBlock = "DIMARO"
;   ArrowheadSize = 0.125
;   ArrowheadType = 20
;   BlockConnectionType = 0
;   BlockScale = 1.0
;   ContentBlockName = ""
;   ContentBlockType = 6
;   ContentType = 2
;   Document (RO) = #<VLA-OBJECT IAcadDocument 00000179bce86c08>
;   DogLegged = -1
;   DoglegLength = 0.125
;   EntityTransparency = "ByLayer"
;   Handle (RO) = "6E12"
;   HasExtensionDictionary (RO) = 0
;   Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 0000017a1e362678>
;   LandingGap = 0.045
;   Layer = "C-VI041DIMS"
;   LeaderCount (RO) = 1
;   LeaderLineColor = #<VLA-OBJECT IAcadAcCmColor 0000017a1e362f70>
;   LeaderLinetype = "ByBlock"
;   LeaderLineWeight = -2
;   LeaderType = 1
;   Linetype = "ByLayer"
;   LinetypeScale = 1.0
;   Lineweight = -1
;   Material = "ByLayer"
;   ObjectID (RO) = 79
;   ObjectName (RO) = "AcDbMLeader"
;   OwnerID (RO) = 112
;   PlotStyleName = "ByLayer"
;   ScaleFactor = 20.0
;   StyleName = "STandard"
;   TextAttachmentDirection = 0
;   TextBackgroundFill = -1
;   TextBottomAttachmentType = 0
;   TextDirection = 5
;   TextFrameDisplay = 0
;   TextHeight = 0.11
;   TextJustify = 1
;   TextLeftAttachmentType = 1
;   TextLineSpacingDistance = 3.66667
;   TextLineSpacingFactor = 1.0
;   TextLineSpacingStyle = 1
;   TextRightAttachmentType = 5
;   TextRotation = 0.0
;   TextString = "S 68°53'19\" E 51.54'"
;   TextStyleName = "Standard"
;   TextTopAttachmentType = 0
;   TextWidth = 0.0
;   TrueColor = #<VLA-OBJECT IAcadAcCmColor 0000017a1e362fd0>
;   Visible = -1

Layer name  (lname): C-VI041DIMS
Pick point  (nselp): 1643424.0459, 581072.3523, 0
First def pt (pt10): 1643432.4055, 581082.8099, 0
Entity type        : MULTILEADER
Entity list is named: edata

Command:
Command: EDUMP

WCS coordinates = nil
  -1 = ENAME  <Entity name: 179f3f8b620>
   0 = STR  MULTILEADER
   5 = STR  6E12
   8 = STR  C-VI041DIMS
  10 = LIST  (1.64343e+06 581083.0 0.0)
  11 = LIST  (0.0 0.0 1.0)
  12 = LIST  (1.64343e+06 581084.0 0.0)
  13 = LIST  (1.0 0.0 0.0)
  40 = REAL  20.0
  41 = REAL  2.2
  42 = REAL  0.0
  43 = REAL  0.0
  44 = REAL  0.0
  45 = REAL  1.0
  67 = INT  0
  90 = INT  -1023410170
  91 = INT  -1073741824
  92 = INT  0
  93 = INT  0
  95 = INT  3
 100 = STR  AcDbEntity
 110 = LIST  (1.64341e+06 581052.0 0.0)
 111 = LIST  (1.0 0.0 0.0)
 112 = LIST  (0.0 1.0 0.0)
 140 = REAL  2.5
 141 = REAL  1.25
 142 = REAL  0.0
 143 = REAL  0.0
 145 = REAL  0.9
 170 = INT  1
 171 = INT  1
 172 = INT  5
 173 = INT  0
 174 = INT  1
 175 = INT  3
 176 = INT  0
 177 = INT  0
 178 = INT  0
 179 = INT  1
 270 = INT  2
 271 = INT  0
 272 = INT  9
 273 = INT  9
 290 = INT  1
 291 = INT  1
 292 = INT  1
 293 = INT  0
 294 = INT  0
 295 = INT  0
 296 = INT  0
 297 = INT  0
 300 = STR  CONTEXT_DATA{
 301 = STR  }
 302 = STR  LEADER{
 303 = STR  }
 304 = STR  S 68°53'19" E 51.54'
 305 = STR  }
 330 = ENAME  <Entity name: 1821d537020>
 340 = ENAME  <Entity name: 1821d537230>
 341 = ENAME  <Entity name: 0>
 342 = ENAME  <Entity name: 1821d537350>
 343 = ENAME  <Entity name: 1821d537230>
 410 = STR  Model

 

 

 

I created a routine a little while back that removes all the leaders from a MULTILEADER using Visual Lisp (vla-removeleader ...) and then it adds back a couple of leaders via (COMMAND ...) input (here,  latest lisp of that is attached).  Doing that fixed this problem.  It seems that something about the leader part of the MULTILEADER gets jacked and it simply cannot be repaired by autolisp as far as I can tell.  Removing it via the context (right-click) menu does not fix it either.  Doing that leaves a jacked up Z-value:

 

 

 

                  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

 

 

 

 P.S. Assoc 90,91 values were puzzling and they could not be changed via autolisp.

P.P.S I ran into a MULTILEADER that did not like any of these efforts (and I found I needed to force the Z-values in my lisp routine to 0.0... so I made that change and reattached it... but that did not help my troublesome MULTILEADER to like it).  So, I exploded the multileader and then exploded the "Previous" selection (all its parts) and then deleted the subsequent "Previous" selection except for the TEXT objects.  Then, I recreated the Multileader from the TEXT and that worked <whew... what a chore!> .

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
Message 20 of 23

hencoop
Advisor
Advisor

I have discovered the source of the jacked up Z-values!  It's the CHSPACE command!  The Z-values are 0.0 before I use CHSPACE and afterwards they Z-values are -#.##e99!

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