Invent dim Id creation by code?

Hi,

Thanks for your reply.But here i need to pass invent dim record.But I have only color id,config id,size id.Could you please explain in detail.