first python script problem

i am trying to make a script that will generate “buildings” of different sizes to look like a city. it is based extensively on the demo script in the Blender 2.3 guide.

i have gotten the GUI to work, but i cant figure out how to create vertices for the “building” object, called poly.

here is the script so far, please help in any way u can




#Cityscape v.01
#based extensively on the Demo Script in the Blender 2.3x Manual
##########################################
import Blender
from Blender import NMesh
from Blender.BGL import *
from Blender.Draw import *

import math
from math import *

#building parameters
T_height = Create(10)
T_width  = Create(1)
T_depth  = Create(1)

#Events
EVENT_NOEVENT = 1
EVENT_DRAW    = 2
EVENT_EXIT    = 3
############################################
#Drawing GUI
############################################
def draw() :
	global T_height
	global T_width
	global T_depth
	global EVENT_NOEVENT, EVENT_DRAW, EVENT_EXIT

	##############title
	glClear(GL_COLOR_BUFFER_BIT)
	glRasterPos2d(8, 123)
	Text("Cityscape")	
	
	############# GUI buttons
	glRasterPos2d(8, 103)
	Text("Settings")
	T_height = Number("Height: ", EVENT_NOEVENT,
						10, 75, 210, 18,
				T_height.val, 1, 60, "Height of building") ;
	T_width = Number("Width: ", EVENT_NOEVENT,
						10, 55, 210, 18,
				T_width.val, 1, 10, "Width of building") ;
	T_depth = Number("Depth: ", EVENT_NOEVENT,
						10, 35, 210, 18,
				T_depth.val, 1, 10, "Depth of building") ;
	############Draw and Exit Buttons
	Button("Draw", EVENT_DRAW, 10, 10, 80, 18)
	Button("Exit", EVENT_EXIT, 140, 10, 80, 18)

##################################################
#Handling Events
###################################################
def event(evt, val):	
	if (evt == QKEY and not val): 
		Exit()

def bevent(evt):
	global T_height
	global T_width
	global T_depth
	global EVENT_NOEVENT,EVENT_DRAW,EVENT_EXIT

	######### Manages GUI events
	if (evt == EVENT_EXIT): 
		Exit()
	elif (evt== EVENT_DRAW):
		Building(T_height.val, T_width.val, T_depth.val)
 		Blender.Redraw()

Register(draw, event, bevent)

########################################					
#Creating the building
########################################
def Building(height, width, depth):

##############Create the mesh
	poly = NMesh.GetRaw()

############## Add vertices

		




############################################
#keeps on ground
if (Blender.bylink):
	obj = Blender.link
	if (obj.LocZ < 0): obj.LocZ = 0.0
	if (obj.LocZ > 0): obj.LocZ = 0.0


	

there is a script caled “city block generator”, or now it’s called BEAST, i think… search for that, it might help.

you trying to learn how to python script or just get the effect

if you just want the effect then go get beast, if you want to learn python coding then i’ll help you with your script

MacBlender