Search the Knowledge Base Report a bug
Post new topic   Reply to topic   printer-friendly view   .    ArchiCAD-Talk Forum Index >>> Developer Forum >>> (Bug?) Level Dimension dimForm not recognizing some symbols
View previous topic :: View next topic
Author Message
Erenford
New member
New member

Joined: 30 Jun 2014
Posts: 25
Location: Philippines, Makati City

PostPosted: Tue Nov 29, 2016 9:56 am    Post subject: (Bug?) Level Dimension dimForm not recognizing some symbols Reply with quote

Greetings, I've tried creating a Level Dimension element with 'dimForm' set to 10 and after creation it reverts back to 0. Even if I don't set it thru code (just the ACAPI_Element_GetDefaults) but set the symbol thru ArchiCAD as default it still reverts back to 0 upon creation of element. Further experimentation reveals values 10 and above are not being recognize by API; these are also symbols not in the documentation.

I've attached a picture with all the symbols and respective values along with the documentation with symbol pic. Circled ones are not being accepted.

Any solution for this?



Level Dimension dimForm.PNG
 Description:
 Filesize:  50.15 KB
 Viewed:  57 Time(s)

Level Dimension dimForm.PNG



_________________
Archicad 18 6101 INT FULL
Archicad 19 3003 INT FULL
Archicad 20 3012 INT FULL
Win 7 Pro SP 1 64-bit
Intel Core i7-2600 CPU @3.40GHz
Back to top
View user's profile Send private message    
Erenford
New member
New member

Joined: 30 Jun 2014
Posts: 25
Location: Philippines, Makati City

PostPosted: Fri Dec 02, 2016 3:50 am    Post subject: Re: (Bug?) Level Dimension dimForm not recognizing some symb Reply with quote

I've experimented a little bit and found a partial solution and another problem. Since the symbol I need is available from the accepted ones only that the text is different, I just used 'dimForm = 0' (with superscripted text) then adjusted the text position for my liking.

The problem I encountered is that "create -> adjust" only works for static level, for the attached with parent type the ACAPI_Element_Change throws out a APIERR_GENERAL.

I've also notice that the dimForm documentation image is updated on AC20 (same as the options in Lvl Dim settings) unlike before on AC19, but it's still not working though (the testing below is done using AC20 v3012)

Testing:
- Set the Lvl Dim with note1.pos already adjusted then create -> Does not apply the position

- Create the Lvl Dim as static then adjust note1.pos then change -> Success

- Create the Lvl Dim with parent then set (or even nothing, just cleared mask) then change -> APIERR_GENERAL

- Create with dimForm as 10+ -> Will not apply, reverts back to value 0

- Change the element (after creation and as static type) dimForm to 10+ -> Does not also work, reverts to value 0

The code I used:
Code:

void CreateLevelDimension(API_Element& i_elemParent)
{
   API_Element elem;
   GSErrCode err = NoError;
   BNZeroMemory(&elem, sizeof(elem));
   elem.header.typeID = API_LevelDimensionID;
   err = ACAPI_Element_GetDefaults(&elem, nullptr);
   if (err != NoError)
   {
      DBGPrintlnf("["__FUNC__"] ERROR %s - ACAPI_Element_GetDefaults", ErrId2Name(err));
      return;
   }
   // get the center of the element
   tdv_Coord coordList = GetMemoCoords(i_elemParent, false);
   API_Coord centerPoly = GetPolyCentroid(coordList, false);
   elem.levelDimension.loc = centerPoly;

//    elem.levelDimension.dimForm = 4;

   // static type
   elem.levelDimension.staticLevel = true;
   // attached to parent
//    elem.levelDimension.staticLevel = false;
//    elem.levelDimension.parentGuid = i_elemParent.header.guid;
//    elem.levelDimension.parentType = i_elemParent.header.typeID;

   ACAPI_CallUndoableCommand("Create Level Dimension", [&] () -> GSErrCode {
   err = ACAPI_Element_Create(&elem, nullptr);
   return NoError; });
   if (err != NoError)
   {
      DBGPrintlnf("["__FUNC__"] ERROR %s - ACAPI_Element_Create", ErrId2Name(err));
      return;
   }

   // Get the newly created element then change the text position
   err = ACAPI_Element_Get(&elem);
   if (err != NoError)
   {
      DBGPrintlnf("["__FUNC__"] ERROR %s - ACAPI_Element_Get()", ErrId2Name(err));
      return;
   }
      
//    elem.levelDimension.dimForm = 14;
   // Adjust the text
   elem.levelDimension.note1.pos.x += 0.125;
   elem.levelDimension.note1.pos.y += -0.375;

   API_Element elemMask;
   ACAPI_ELEMENT_MASK_CLEAR(elemMask);
   ACAPI_ELEMENT_MASK_SET(elemMask, API_LevelDimensionType, note1.pos);
//    ACAPI_ELEMENT_MASK_SET(elemMask, API_LevelDimensionType, dimForm);

   ACAPI_CallUndoableCommand("Change Element", [&] () -> GSErrCode {
   err = ACAPI_Element_Change(&elem, &elemMask, nullptr, NULL, true);
   return NoError; });
   if (err != NoError)
   {
      DBGPrintlnf("[Error] %s "__FUNC__" - ACAPI_Element_Change()", ErrId2Name(err));
   }
}

_________________
Archicad 18 6101 INT FULL
Archicad 19 3003 INT FULL
Archicad 20 3012 INT FULL
Win 7 Pro SP 1 64-bit
Intel Core i7-2600 CPU @3.40GHz
Back to top
View user's profile Send private message    
KatalinBorszeki
Graphisoft

Joined: 18 Jan 2013
Posts: 313
Location: Hungary

PostPosted: Thu Feb 09, 2017 2:00 pm    Post subject: Re: (Bug?) Level Dimension dimForm not recognizing some symb Reply with quote

Hi Erenford, this is an error on our end. Thanks for letting us know, we have entered it in the development database and planning to fix it soon.
Best, k

_________________
Katalin Borszeki
Implementation Specialist
GRAPHISOFT

http://helpcenter.graphisoft.com - the ArchiCAD knowledge base
Back to top
View user's profile Send private message Visit poster's website    
Display posts from previous:   
View previous topic :: View next topic
Post new topic   Reply to topic   printer-friendly view       ArchiCAD-Talk Forum Index >>> Developer Forum >>> (Bug?) Level Dimension dimForm not recognizing some symbols All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2001, 2005 phpBB Group
Copyright 2012 - Graphisoft SE. All rights reserved worldwide. Terms of Use | Privacy Policy