How to use the 'LibPart' to create Axis Net?
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2009-01-13
04:45 AM
- last edited on
ā2024-09-09
10:51 AM
by
Doreena Deng
ā2009-01-13
04:45 AM
I have found the 'LibPart' of the element of Axis Net. But when I create, it error.
What's wrong?
BNZeroMemory (&element, sizeof (API_Element)); BNZeroMemory(&element, sizeof(API_ElementMemo)); element.header.typeID = API_ObjectID; ACAPI_Element_GetDefaults(&element, &memo); for(int j = 0; j < addParNum; j++) { API_AddParType &addPar = (*addPars); if(CHEqualCStrings(addPar.name, "AC_MarkerText_1")) { GS::ucscpy(addPar.value.uStr, L("A")); } } element.object.pos.x = c.x; element.object.pos.y = c.y; element.object.libInd = libPart.index; element.object.angle = 0; memo.params = addPars; err = ACAPI_Element_Create(&element, &memo); ACAPI_DisposeElemMemoHdls(&memo);it returns the error "APIERR_BADPARS".
What's wrong?
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2009-01-14 02:05 PM
ā2009-01-14
02:05 PM
wcyoot wrote:You haven't shown all your source code, so the problem may be outside of this, e.g how did you obtain
I have found the 'LibPart' of the element of Axis Net. But when I create, it error.
You also have an obvious bug here:
BNZeroMemory(&element, sizeof(API_ElementMemo));That should be:
BNZeroMemory(&memo, sizeof(API_ElementMemo));That bug alone may be causing the problem (because the memo fields are not initialised to zero). I recommend starting with code from the examples bundled with the API. You could look at the code for
Ralph Wessel BArch
Central Innovation
Central Innovation
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2009-01-16 08:21 AM
ā2009-01-16
08:21 AM
I am sure I have got the libPart and addPars , because I have debug it step and step.I also correct that bug. But has no effect.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2009-01-16 03:55 PM
ā2009-01-16
03:55 PM
wcyoot wrote:OK. Can you confirm you are using
I am sure I have got thelibPartand addPars, because I have debug it step and step.I also correct that bug. But has no effect.
Also, check the attributes of the newly created object, particularly the layer.
Also, what type of library part are you trying to place, i.e. what is "Axis Net"? Is it a simple object, or does it have a 'special' purpose, e.g. a door, window, or label, which might require different data?
I also recommend simplifying your code as much as possible when you hit a snag like this. Take out anything inessential, e.g. the code that modifies the "AC_MarkerText_1" parameter, so you reduce the problem to the smallest possible subset of commands. Once the essential code works you can continue adding additional features
Ralph Wessel BArch
Central Innovation
Central Innovation
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2009-01-20 08:29 AM
ā2009-01-20
08:29 AM
I'm sure I have used ACAPI_OpenUndoableSession , I have used the same way to create another LibPart , but I cannot create this by the same way.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2009-02-05 04:54 PM
ā2009-02-05
04:54 PM
wcyoot wrote:Where are the addPar and the libPart.index coming from? Is it possible that you really have a bad set parameters?
I'm sure I have usedACAPI_OpenUndoableSession, I have used the same way to create another LibPart, but I cannot create this by the same way.
best,
Akos