기본 콘텐츠로 건너뛰기

5월, 2006의 게시물 표시

acedSSGet으로 entity 선택할 때의 고려사항

acedSSGet 함수는 단적으로 말해서 화면에 보이는 entity만을 선택합니다. 예를 들어 "W"로 해서 선택할때 영역을 설정하게 되는데 영역이 드로잉의 모든 entity를 포함하더라도 화면에 보이지 않는 entity들은 선택되지 않습니다. 물론 자세한 내용은 도움말 파일에 나와 있습니다. 도움말 파일을 읽는 습관을 기르자...

whether clockwise or counterclockwise

picbuddy님의 블로그(Mesh Generation) | 서캐 http://blog.naver.com/picbuddy/80021589591 Determining whether or not a polygon (2D) has its vertices ordered clockwise or counterclockwise Written by Paul Bourke March 1998 The following describes a method for determining whether or not a polygon has its vertices ordered clockwise or anticlockwise for both convex and concave polygons. A polygon will be assumed to be described by N vertices, ordered $$ (x_0,y_0),(x_1,y_1),(x_2,y_2),...(x_{n-1},y_{n-1}) $$ A simple test of vertex ordering for convex polygons is based on considerations of the cross product between adjacent edges. If the crossproduct is positive then it rises above the plane (z axis up out of the plane) and if negative then the cross product is into the plane. $$ \begin{aligned} cross product &= ((x_i - x_{i-1}),(y_i - y_{i-1})) \times ((x_{i+1} - x_i),(y_{i+1} - y_i))\\ &= (x_i - x_{i-1}) * (y_{i+1} - y_i) - (y_i - y_{i-1}) * (x_{i+1} - x_i) \en

블럭의 색상 변경하기

사용 함수 : ArxSetBlockRefColor(AcDbBlockReference* pBlkRef , const int& colorIndex) /** \brief The ArxSetBlockDefColor function \param objId a parameter of type const AcDbObjectId& \param colorIndex a parameter of type const int& \return void */ void ArxSetBlockDefColor(const AcDbObjectId& objId , const int& colorIndex) { USES_OKEYS; AcDbBlockTableRecord* pRcd; try { ARXOK(acdbOpenObject(pRcd,objId,AcDb::kForRead)); ////////////////////////////////////////////////////////////////////////// AcDbBlockTableRecordIterator* pIterator; if(Acad::eOk == pRcd->newIterator(pIterator)) { for(;pIterator && !pIterator->done();pIterator->step()) { AcDbEntity* pEnt; try { ARXOK(pIterator->getEntity(pEnt,AcDb::kForWrite)); if(pEnt->isKindOf(AcDbBlockReference::desc())) { AcDbObjectId blockId = AcDbBlockReference::cast(pEnt)->blockTableRecord(); pEnt->setColorIndex(c

TreeView 연습중..

☆하늘을 보쟈☆ | 미야 http://blog.naver.com/ratmsma/40012501600 //아이콘 가져오기 m_Image=new CImageList; m_Image->Create(16,16,ILC_COLOR4,3,3); m_Image->Add(AfxGetApp()->LoadIcon(IDI_ICON1)); m_Image->Add(AfxGetApp()->LoadIcon(IDI_ICON2)); //트리에 설정 m_tree.SetImageList(m_Image,TVSIL_NORMAL); //노드추가 HTREEITEM hLevel1,hLevel2; hLevel1=m_tree.InsertItem(treename1[0],0,1); //함수의 반환값 HTREEITEM으로 노드를 추가할 수 있다. for(int i=0;i<2;i++){ hLevel2=m_tree.InsertItem(treename2[i],0,1,hLevel1); for(int j=0;j<3;j++){ m_tree.InsertItem(treename3[i][j],0,1,hLevel2); } // m_tree.Expand(hLevel2,TVE_EXPAND); //확장 함수 } // m_tree.Expand(hLevel1,TVE_EXPAND); //아이템 선택시 선택된 아이템 알아보기 : TVN_SELCHANGED메시지 NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; HTREEITEM hTreeItem = pNMTreeView->itemNew.hItem; // 이 값이 선택된 아이템의 핸들 CString str=m_tree.GetItemText(hTreeItem); Setwindow(str); //or 다른 에디트 등에 넣을 수도 있다.GetDlgItem(IDC_EDIT1)->SetWindow(str); <여기서, HTREEITEM