Getting vertices of an entity from a linked DWG


I'm linking a dwg file into max and the I'm trying to get the the vertices of a line on a certain layer. I know that I have only one line on that layer.
Then I try to create a camera using the retrieved points, but I get only [0,0,0] coordinates.
What am I doing wrong?
The code looks like this:

for i = 0 to layerManager.count-1 do
	ilayer = layerManager.getLayer i
	layerName =	
	if matchpattern layerName pattern:"CAM-IN*" do
		splitName=filterstring layerName "-"
		ilayer.nodes &theNodes
		for n in theNodes do
			format "\na = %" a
			addmodifier a c
			mypoint1 = a.modifiers[#Edit_Poly].Getvertex 1
			mypoint2 = a.modifiers[#Edit_Poly].Getvertex 2
			format "\n%" layerName
			format "\n% - %" mypoint1 mypoint2
			max create mode
			newcam = TargetCamera name:cameraname pos:mypoint2 target:(TargetObject name:(cameraname + ".Target") pos:mypoint1)

Any advice would be appreciated.
Thank you.