News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

macro - move name of layer to other layer

Started by Lebbeke, March 08, 2011, 11:48:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lebbeke

Good evening from the worldrecord country without a government (this a not complete true cause we have in fact to many governments)

I am writing a macro to move the content from a drawing to higher layers.
I have no problem moving the content up 100 layers.
But i want to move the layernames also.
I have 2 unexpected problems:
1. the name of the layer is not read completly.
2. when moving the names (the second part) the macro stops after 30 steps.

Any ideas?
i ' out some message that help me control the macro

precision 0

dim naam

n = sys(9)
message "aantal entities :", n
input "hoeveel opschuiven? ", a

Sys(36) = 1  'set silent mode for speed

j = 0

for j = 1 to sys(9) ' sys(9) is the number of entities
  getattr j, type, select, layr, group, red, green, blue
  layr = layr + a
  putattr j, type, select, layr, group, red, green, blue
next j

'message "data verplaatst"

l=0
for l = 1 to a-1
'message "a-1 = ", a-1

layer(l)=14 'maak current
naam = sys$(93)

'message "laag + naam = ", l+a, naam

sys$(93)=""
b=l+a
layer(b)=14
sys$(93)=naam
next l

'message "namen verplaatst"

Lebbeke

Sorry, It as been a while since i made a macro
newbie mistake (naam$)

Maybe someone likes the macro. It usefull when joining 2 drawings.

magic

Hi Lebbeke,

I could use your macro, and I'd like a copy of the finished version, but I think I'd understand it better, if the messages were in English.

Thank you very much.
It's a kind of magic!




paulerens

#3
Mr.magic,
From Flemish to English
'================================
precision 0

Dim name$

n = sys (9)
message "number of entities", n
Input "how much layers to move ?", a

Sys (36) = 1 "set silent mode for speed

j = 0

for j = 1 to system (9) "sys (9) is the number of entities
  getattr j, type, select, LAYRE, group, red, green, blue
  LAYRE = LAYRE + a
  putattr j, type, select, LAYRE, group, red, green, blue
next j

message" data moved "

l = 0
for l = 1 To A-1
'message' = a-1, a-1

layer (l) = 14 'make current
name$ = sys $ (93)

'message" name$ = LAYER + ", l + a, name$

sys $ (93) = ""
b = l + a
layer (b) = 14
sys $ (93) = name$
next l
'message' names moved "
End
'============================
Paul.

magic

It's a kind of magic!