Q&A

  • 고수님들 좀 가르쳐주세요.
제가 하려는 것은요. vba로 만든 것을 델파이로 옮기려는데 잘 안됩니다.

다음은 vba코드와 제가 옮기려는 델파이코드입니다.

질문내용은 마지막에 하겠읍니다.

먼저 잠깐 코드를 살펴봐주시지요.



For Each elem In myDoc.ModelSpace

If elem.EntityName = "AcDbBlockReference" Then

If elem.HasAttributes Then

array1 = elem.GetAttributes

For count = LBound(array1) To UBound(array1)

If (array1(count).EntityName) = "AcDbAttribute" Then

For i = 1 To nms.count

If Mid(xls_data(i), 2, Len(xls_data(i)) - 2) = array1(count).TagString Then

array1(count).textstring = xls_value(i)

End If

Next i

End If

Next count

End If

End If

Next elem









for i:= 0 to elem.count-1 do

if elem.item(i).entityname ='AcDbBlockReference' then

if elem.item(i).HasAttributes then

begin

cad_blockdata := elem.item(i).getattributes ;

///////////////////////////////////////////////////////////////////////////////

for j := vararraylowbound(cad_blockdata,1) to vararrayhighbound(cad_blockdata,1}

///////////////////////////////////////////////////////////////////////////////

윗부분 에러남



do

if (cad_blockdata[j].entityname)='AcDbAttribute' then

for k= 1 to num_xl_name do

if copy(tmp_name[k],2, length(tmp_name[k])-2) = cad_blockdata[j].TagString then

cad_blockdata[j].textstring := tmp_no[k];

end;







제가 궁금한것은요

1. vb의 for each elem in mydoc.modelspace 와 같은 기능을 하는 델파이 함수는 없나요.





2. vb에서 variant 데이터 타입은 배열에 자동 저장되는것 같은데(ex: array1 = elem.GetAttributes

For count = LBound(array1) To UBound(array1))

델파이에서는 왜 이게 안되지요?



정말 궁금합니다. 제가 혼자 공부하다보니 델파이의 개념이 없읍니다. 부디 자세히좀 가르쳐 주세요. 그리고 맨날 질문만 해서 죄송합니다.



1  COMMENTS