Neighbor example?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/03/2011 at 11:13, xxxxxxxx wrote:

Hi,

I'm trying to get the polygons that are attached to point index[1] of  a cube. But I can't figure out how to instantiate the Neighbor class.

Does anyone have an example of this?

-ScottA

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/03/2011 at 11:22, xxxxxxxx wrote:

The neighbor class contains a Init method. In combination with Neighbor.GetPointPolys( pnt ) you san get the neighbor polygons.
Cheers, Sebastian

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/03/2011 at 11:44, xxxxxxxx wrote:

And maybe this Open Source plugin helps you.

Open Edges - Py4D Open Source plugin - nux95 - cgsociety

Greets, Niklas

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/03/2011 at 12:33, xxxxxxxx wrote:

Thanks nux.
That's exactly what I needed. 🍺

This is an example of all I was trying to do with it:

import c4d  
from c4d import gui,utils  
  
def main() :  
    
  obj = doc.GetActiveObject()  
  AllPoints = obj.GetPointS() # Gets all the points   
  PointIndex = AllPoints.Select(1) # Gets point index #1   
  c4d.EventAdd()    
  nb = utils.Neighbor() # Assigns neighbor to a variable  
  nb.Init(obj) # Instantiates the neighbor class   
  
  selected = nb.GetPointPolys(PointIndex) # Gets the id's of those neighboring polygons  
  print selected  
    
  c4d.EventAdd()  
  
  
if __name__=='__main__':  
  main()  

I'm sure the SDK about this makes sense to people with years of coding experience. But I couldn't figure out what it was was trying to tell me on how to use this class.

Thanks a lot for the for the example file.
-ScottA

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/03/2011 at 14:19, xxxxxxxx wrote:

In my opinion, the Init() function is described very well.
I started Coffee 3 months ago and Python about 1 month ago. :)

Greetings,
Niklas

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/03/2011 at 15:40, xxxxxxxx wrote:

I'm sure it is.
But what do you do if you suck at reading SDK's. And can't find any tutorials to teach you how to read them?

Welcome to my world.
-ScottA

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/03/2011 at 15:46, xxxxxxxx wrote:

At the beginning I really didn't understand anything in SDK's. But it became easier by time.

But I sometimes don't understand SDKs, too, since the entries are not always that senseful.