Walls with dimensions name?

I spend a lot of time creating walls, measuring and renaming. I just wanted to create lines in top view and execute a command that adds 10 Outline 320 extrude mesuare the length of the line i created and rename object:
"Wall X, 10, 320" are the values that I use most.
(if there is a text box that I could imput all value and create, would be perfect, but it would probably be hard to create, I think)
thanks guys

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Michele71's picture

Thanks barigazy, but I would

Thanks barigazy, but I would prefer that you do it :)

barigazy's picture

...

Come on man! :)
The code is very easy. It is harder to write code for UI here then actual function for GO! button :)

bga

Michele71's picture

hahahahhah !! the time that I

hahahahhah !! the time that I miss, I'm always busy with work!!! Is hard find the time to make these small changes :)

barigazy's picture

...

Same here :) My work is not mxs related so ...

bga

Gabriel Corazza's picture

Definitely perfect!

I separate my objects by edge color, you helped me more than enough. The name is exactly the right way. Many thanks again. You have an impressive speed of creation. Congratulations for the excellent work, I'm sure you've helped a lot more people that have this problem! Thank you very much, for helping me the second time! Peace bro!

barigazy's picture

...

Yup. I definitely lost the count :)

bga

barigazy's picture

...

I added few more options:
-- support for multiple objects
-- reverse knots order of selected spline or all "attached" shapes
-- 2 modes: use offset shape and extrude modifier method or combo with extrude and shell modifier which is more flexible solution for sure
-- created modifiers can be instance or copy

try (destroyDialog ::create_wall) catch()
rollout create_wall "Create Quick Wall"
(
	local walls = #()
	fn filterShape shape = isKindOf shape SplineShape or isKindOf shape Line 
 
	group "Enter Name Wall ..." 
	(
		edittext et_wallname "" pos:[5,25] width:145 height:17 text:"Wall"
	)
	group "Wall Params ..." 
	(
		radiobuttons rb_mode "Mode:" labels:#("Outline-Extrude", "Extrude-Shell") pos:[10,70]
		spinner spn_outline "Outline   =  " range:[-1e5,1e5,10] type:#worldunits pos:[11,120] fieldwidth:70
		spinner spn_extrude "Extrude  =  " range:[-1e5, 1e5,320] type:#worldunits pos:[10,140] fieldwidth:70
		checkbox cb_extrude "Instance Extrude Modifier" checked:on pos:[10,160]
		spinner spn_shellin "Shell In   =  " range:[0,1e5,5] type:#worldunits pos:[10,180] fieldwidth:70 enabled:off
		spinner spn_shellout "Shell Out = " range:[0,1e5,5] type:#worldunits pos:[11,200] fieldwidth:70 enabled:off
		checkbox cb_shell "Instance Shell Modifier" checked:on pos:[10,220] enabled:off
		button btn_reverse "Reverse Knots Order" pos:[10,240] width:140 height:18
		button btn_delete "Delete Walls" pos:[10,260] width:140 height:18
	)
	group "Create Wall ..." 
	(
		button btn_create "G O !" pos:[10,305] width:140 height:18
	)
	on rb_mode changed state do 
	(
		if state == 1 then 
		(
			spn_outline.enabled = on
			spn_shellin.enabled = spn_shellout.enabled = cb_shell.enabled = off
		)
		else 
		(
			spn_outline.enabled = off
			spn_shellin.enabled = spn_shellout.enabled = cb_shell.enabled = on
		)
	)
 
	on btn_delete pressed do 
	(
		delete (for node in walls where isValidNode node collect node) ; free walls
	)
 
	on btn_reverse pressed do if selection.count == 0 then messagebox "Select Shape Object" title:"Warning" beep:off else
	(
		with redraw off
		(
			for sp in selection where filterShape sp do 
			(
				integer = numSplines sp
				number = if (e = getSplineSelection sp).count == 0 then (#{1..numsplines sp} as array) else e
				for n in number do reverse sp n
			)
		)
	)
 
	on btn_create pressed do if selection.count == 0 then messagebox "Select Shape Object" title:"Warning" beep:off else
	(
		if et_wallname.text == "" then messagebox "Enter Some Name" title:"Warning" beep:off else
		(
			if GetCommandPanelTaskMode() != #create do setCommandPanelTaskMode #create
			node = (Extrude amount:spn_extrude.value)
			modifier = if rb_mode.state == 2 do (Shell innerAmount:spn_shellin.value outerAmount:spn_shellout.value straightenCorners:on)
			with redraw off
			(
				for sp in selection where filterShape sp do 
				(
					shape = copy sp name:(uniquename et_wallname.text)
					append walls shape
					if spn_outline.value != 0 and rb_mode.state == 1 do applyOffset shape spn_outline.value
					if spn_extrude.value != 0 do
					(
						if not cb_extrude.checked then addmodifier shape (copy node) else addmodifier shape node
					)
					if rb_mode.state == 2 do
					(
						if not (spn_shellin.value == 0 and spn_shellout.value == 0) do
						(
							if not cb_shell.checked then addmodifier shape (copy modifier) else addmodifier shape modifier
						)				
					)
				)
			)
		)
	)
)
createDialog create_wall 160 330 10 110 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)

bga

Gabriel Corazza's picture

This is hot!

I enjoyed the new functions, this script will save me much time. It would be nice if he could group the wall at the end with just the name that I put, without the number "002" or "003" etc. Thank you for facilitating my work! You guys are great!

Michele71's picture

Great job barigazy :)

Great job barigazy :)

Michele71's picture

I hope this can help. The

I hope this can help. The only requirement (for now) is that you must select ONE splineshape at a time. The splineshape can be closed or open. If you find error, please let me know!!

if create_wall != undefined do destroyDialog create_wall
try destroyDialog create_wall catch()
 
rollout create_wall "Create Quick Wall"
(
global copy_shape, cs
 
--- start rollout...
group "Enter Name Wall ..." (
edittext name_wall ""
)
group "Edit Wall ..." (
spinner outp "Outline = " range:[-10000,10000,2] type:#worldunits
spinner amou "Extrude = " range:[-10000, 10000, 25] type:#worldunits
)
 
group "create Wall ..." (
button cre "Go!"
)
 
group "Destroy wall..."(
	button des "Destroy and start again ..."
)
 
--- start create wall...
on cre pressed do
(
 if superclassof $ != shape then messagebox "No SplineShape Selected!!\n Please select Spline..."
 else
		if $ != undefined then
		(
if name_wall.text != "" do
for i in selection do i.name = uniquename name_wall.text
---
copy_shape = copy $
cs = convertToSplineShape copy_shape
select cs
modPanel.setCurrentObject cs.baseObject
subobjectLevel = 3
setSplineSelection  cs #(1)
applyOffset cs outp.value -- insert the value of outline...
updateshape cs 
mod_extrude = addModifier cs (Extrude())
cs.extrude.amount = amou.value -- insert the value of extrude...
)
else messagebox "No SplineShape in the scene"
)
on des pressed do 
(
	if superclassof $ == shape then messagebox "You have selected the SplineShape\n Please select a Wall..."
	else
	if superclassof $ != shape then
	(
	delete selection
	)
 
)
)
CreateDialog create_wall

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.