Incompatible types: 6, and undefined - Parametric Design for Architecture: Diagrid Issue

Incompatible types: 6, and undefined - Parametric Design for Architecture: Diagrid Issue

Anonymous
Not applicable
892 Views
2 Replies
Message 1 of 3

Incompatible types: 6, and undefined - Parametric Design for Architecture: Diagrid Issue

Anonymous
Not applicable

I'm currently working through Wassim Jabi's Parametric Design for Architecture and I've gotten to a tutorial on creating a parametric diagrid in 3DSMax (MAXScript). The tutorial has you create a Scripted Primitive plugin to generate a diagrid with controlable u and v values.

 

The issue is that when I start to draw the rectangle that will create the grid in 3DSMax, I get the following warning:

 

 -- Incompatible types: 5, and undefined

 

I've wittled it down to being an issue with the following parameter section by changing the U default: value and running it again for it to return the same error with the new value.

 

parameters main rollout:params
(

u type:#integer ui:u_spinner default:5
v type:#integer ui:v_spinner default:5
meshLength type:#worldunits ui:meshLength_spinner default:50
meshWidth type:#worldunits ui:meshWidth_spinner default:50
rotated type:#boolean ui:rotated_checkbox default:false
)

 

I've typed the script out exactly as it says in the book so I'm not sure what could be going wrong, unless MAXScript has changed in some way since the book was published (2013).

 

I'd be grateful for any help or advice.

0 Likes
Accepted solutions (1)
893 Views
2 Replies
Replies (2)
Message 2 of 3

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

as you can see from my snippet:

ca = attributes ca attribID:#(0xBABA, 0xABBA)
(
	parameters main rollout:params
	(
		u type:#integer ui:u_spinner default:5
		v type:#integer ui:v_spinner default:5
		meshLength type:#worldunits ui:meshLength_spinner default:50
		meshWidth type:#worldunits ui:meshWidth_spinner default:50
		rotated type:#boolean ui:rotated_checkbox default:false
	)
	rollout params "BABA ABBA"
	(
		spinner u_spinner "U: "
		spinner v_spinner "V: "
		
		spinner meshLength_spinner "Length: "
		spinner meshWidth_spinner "Width: "
		
		checkbox rotated_checkbox "Rotated"
	)
)

delete objects

max modify mode

b = dummy name:#attr_test isselected:on
custattributes.add b ca 

 

... everything is ok, at least in MXS syntax

 

Message 3 of 3

Anonymous
Not applicable

@denisT.MaxDoctorThanks for doing that. As that wasn't the issue, I've looked further through the script and found that a later section adds the u value to a local variable from a case of function that hould have been a global variable.

0 Likes