Set Z-Heights of objects by layer or color

Set Z-Heights of objects by layer or color

samsona
Explorer Explorer
1,948 Views
7 Replies
Message 1 of 8

Set Z-Heights of objects by layer or color

samsona
Explorer
Explorer

Hi, 

 

Is it possible to assign a z-height of lines/polylines by layers or colors? Layer1 or Blue = ZHeight of 1.5 for example...

 

We are importing a set of lines which come in (pre assigned to layers from Revit) - We then have to assign a z-height to the objects - so... {Layer-1 = ZHeight of 1.5} and {Layer-2 = ZHeight of 3.5} and so on... Currently we have to select a line on the layer, then select similar to select all lines on the layer and manually assign the z-height to the selection - this can be time consuming as we have a lot of layers...

 

is there a way to automate this? Set up an autocad template that has a z-height assigned to a layer or color? So when the lines are imported they are automatically given the z-height data? 

 

**there doesn't seem to be a way to carry z-height data from Revit to AutoCAD, but also open to a solution here as well... 

0 Likes
1,949 Views
7 Replies
Replies (7)
Message 2 of 8

devitg
Advisor
Advisor

@samsona 

 

For better understanding, and maybe get further help, please upload such sample.dwg

0 Likes
Message 3 of 8

Kent1Cooper
Consultant
Consultant

Are they all initially at Z=0?  If so:

 

(command

  "_.move" (ssget "_X" '((8 . "Layer-1"))) "" "0,0,1.5" ""

  "_.move" (ssget "_X" '((8 . "Layer-2"))) "" "0,0,3.5" ""

)

 

[That assumes the Layers are unlocked, and the things on them are in the current space.]

 

If there might not be anything on some Layer(s), it could be made to check for the existence of a given Layer name and whether there's anything drawn on it, before trying the MOVE.

Kent Cooper, AIA
0 Likes
Message 4 of 8

samsona
Explorer
Explorer

that makes sense - will give this a shot - thank you!

0 Likes
Message 5 of 8

dmfrazier
Advisor
Advisor

Template? Probably not.

If the relationships between Layer (and/or Color) and "Z-height" are well-defined and consistent, then I think it would be relatively "easy" for a competent LISP programmer to devise an automation. Posting in the Customization group will get results faster.

0 Likes
Message 6 of 8

samsona
Explorer
Explorer

I'm probably modifying the code incorrectly - so could use some additional help here - attached is a sample cad file - 

 

So all lines/polylines on layer...

A-ELEV-L002 = 1.5 ZHEIGHT

A-ELEV-L003 = 3.5 ZHEIGHT

and so on for the remaining layers... possible in one single command?

 

here is what I tried to do with the command line:

 

(command

"_.move" (ssget "_X" '((8 . "A-ELEV-L002"))) "" "0,0,1.5" ""

"_.move" (ssget "_X" '((8 . "A-ELEV-L003"))) "" "0,0,3.5" ""

)

 

that didn't work - is there an additional part of the code I need to modify other then the layer name? And would you select the lines before or after you enter the command?

 

also - using LT if that matters (unable to move in z-axis with LT?) - plus, we have polylines and line segments which have different ways of describing z-height - polyline uses "elevation" and a line segment uses "start/end Z" - not sure if that matters (maybe not if it is just a move command in the z axis), but we can always explode everything so we stay with "start/end Z" 

 

Thanks!

0 Likes
Message 7 of 8

Kent1Cooper
Consultant
Consultant

@samsona wrote:

.... using LT if that matters ....


Yes, it does.  LT doesn't have AutoLisp capability, so it can't run that code.

Kent Cooper, AIA
0 Likes
Message 8 of 8

samsona
Explorer
Explorer

got it - will install full version and try it again.. 

0 Likes