CAcUiLineWeightComboBox for line weight and what for line types?

CAcUiLineWeightComboBox for line weight and what for line types?

Anonymous
Not applicable
613 Views
3 Replies
Message 1 of 4

CAcUiLineWeightComboBox for line weight and what for line types?

Anonymous
Not applicable
Hi,

 

I used CAcUiLineWeightComboBox to
make combo box for line weigth, now i want to add the same combo box just for
line types (like standart in AutoCAD toolbar). How can i do that?

 

Thank's ! 
0 Likes
614 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
You can't....just kidding.  You'll need
AsdkUnsup2000.arx from


 

It's in article 41853.  Once you have this
extracted in some

directory you'll
need to get the type info from AsdkUnsupp2000.ARX.

Do this by using the class wizard (right click in
your source

code area) and press the button "add class". 
Then select

"from a type library". Now locate and
select the ARX file,

next select the classes to generate code for
(select'em all).

The new code now becomes a part of your
project.

Below is a code fragrment to get you started
working with

AsdkUnsupp2000.arx from ARX. (the code below
may

be in error as I cut and pasted it from a wrapper
class I

wrote for using AsdkUnsupp2000).

 

Paul Kohut

 

AcDbObjectId GetLinetypeFromDialog(LPCTSTR
pcszPreSelected = NULL,

           long
bAllowByLayerByBlock = TRUE)
{
 AcDbObjectId linetypeId; // pre
initialized to
0
 IacadApp.AttachDispatch(acedGetAcadWinApp()->GetIDispatch(TRUE));
 IDispatch
* pDisp =
IacadApp.GetInterfaceObject("Asdkunsupp2000.Application.1");
 if(pDisp)
{
  IsdkApp.AttachDispatch(pDisp);
  
  //
Need a document interface
  IAcadDocument
IDoc;
  IDoc.AttachDispatch(IacadApp.GetActiveDocument());
  
  IDispatch
* pPreSelected = NULL;
  if(pcszPreSelected)
{
   if(strcmp(pcszPreSelected, "") != 0)
{
    // need the linetypes (plural)
interface
    IAcadLineTypes
Ilinetypes;
    Ilinetypes.AttachDispatch(IDoc.GetLinetypes());
    COleVariant
vString(pcszPreSelected);
    pPreSelected =
Ilinetypes.Item(vString);
    Ilinetypes.ReleaseDispatch();
   }
  }
  
  IDispatch
* pDisp = IsdkApp.ShowLinetypeDialog(pPreSelected,
bAllowByLayerByBlock);
  if(pDisp)
{
   IAcadLineType
Ilinetype;
   Ilinetype.AttachDispatch(pDisp);
   linetypeId.setFromOldId(Ilinetype.GetObjectID());
   Ilinetype.ReleaseDispatch();
  }
  IDoc.ReleaseDispatch();
  IsdkApp.ReleaseDispatch();
 }
 IacadApp.ReleaseDispatch();
 return
linetypeId;
}

 



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi,


size=2>
 

I used CAcUiLineWeightComboBox
to make combo box for line weigth, now i want to add the same combo box just
for line types (like standart in AutoCAD toolbar). How can i do
that?

 


size=2>Thank's ! 
0 Likes
Message 3 of 4

Anonymous
Not applicable
Paul,

I think he was after a combo box not a dialog 🙂

Oddly enough (or maybe not so odd after all) a layer combo and linetype combo
are omitted from the AcUi/AdUi API. You'll need to roll your own owner drawn
combo. The trick is the following function exported from acad.exe -

void DrawLTypePattern(CDC*, AcDbObjectId, struct tagRECT*);

For more info see the 'DrawLTypePattern - how does it work ?' thread from 1/15/2002.

--
|
----+----------------------------------------------
| Byron Blattel
| CADwerx---Applications for AutoCAD
| Autodesk Registered Developer
| email: [email protected]
| web site: http://www.cadwerx.net
|
0 Likes
Message 4 of 4

Anonymous
Not applicable
Hi,

That's the problem, how can i write my owner drawn combo. Maybe you coud
give an example?
And what means "exported from acad.exe" :(( For me it's not oddly at all :))

Thank's !!!

"Byron Blattel" wrote in message
news:[email protected]...
> Paul,
>
> I think he was after a combo box not a dialog 🙂
>
> Oddly enough (or maybe not so odd after all) a layer combo and linetype
combo
> are omitted from the AcUi/AdUi API. You'll need to roll your own owner
drawn
> combo. The trick is the following function exported from acad.exe -
>
> void DrawLTypePattern(CDC*, AcDbObjectId, struct tagRECT*);
>
> For more info see the 'DrawLTypePattern - how does it work ?' thread from
1/15/2002.
>
> --
> |
> ----+----------------------------------------------
> | Byron Blattel
> | CADwerx---Applications for AutoCAD
> | Autodesk Registered Developer
> | email: [email protected]
> | web site: http://www.cadwerx.net
> |
>
0 Likes