Eurobricks New Members
  • Content count

  • Joined

  • Last visited

About Neuenk

  1. Ok, if I have installed the next version, I will check and test it.
  2. Hi Roland, On editing my Post above, I also removed some hints Form me above the Code... so before I didn't start directly with code, sorry. There I descripe also the Situation Edith the getSteplineinfo and that has to be confused me..., with result 0 and that the last line Works in an other way. I wrote also, that I Read your editing with the bug to Late and that I had implement a Workaround.(helperline). And this one I can fully understand: And than I ask you, if you can apply this Script to your Next Version. But if you have changed your API, I can also improve my Script. Nice to Read this, you make a great job, thank you Dirk
  3. --Insert selected Steps into Step after current Step ============================================================================================================= function insertSelectionIntoNextStep(createNewStep) --only useful if a model is active. local sf=ldc.subfile() if not sf:isLinked() then ldc.dialog.runMessage('No active model.') return end local ses=ldc.session() local sel=ses:getSelection() local refCnt = sel:getRefCount() if refCnt>0 then local curStep=ses:getCurStepNr() local idxCurStep=sf:getStepLineInfo(curStep) local idxNewStep local addNewStep= createNewStep == true if (sf:getStepCount() > curStep) then idxNewStep=sf:getStepLineInfo(curStep+1) local lineCnt=sf:getLineCount() if ( idxNewStep == 0) then --print('nextStep has no items, we use nextStep for insert') addNewStep= false if (idxCurStep > 0) then --print('curStep has items, so search for curStep Line...') idxNewStep= idxCurStep repeat idxNewStep= idxNewStep+1 until sf:getLine(idxNewStep):isStepMeta() idxNewStep= idxNewStep+1 else --print('curStep has also no items, search for curStep line ...') local steps= curStep repeat idxNewStep= idxNewStep+1 if sf:getLine(idxNewStep):isStepMeta() then steps= steps -1 end until idxNewStep>=lineCnt or steps== 0 if (idxNewStep>=lineCnt) then --print('curStep Line not found') --else --print('curStep Line found: '..idxNewStep) end end elseif (sf:getLine(idxNewStep):isStepMeta()) then --print('nextStep is last step without items, than we get directly the STEP line and use this for insert') addNewStep=false idxNewStep= idxNewStep + 1 else --print('nextStep has items..'..idxNewStep) if (createNewStep) then idxNewStep= idxNewStep - 1 if (idxCurStep == 0) then --print('curStep has no items, we use curStep for insert') addNewStep=false --else --print('curStep has items') end else --print('search for last position..') repeat idxNewStep= idxNewStep+1 until idxNewStep>lineCnt or sf:getLine(idxNewStep):isStepMeta() end end else --print('current Step is last Step') if (not createNewStep) then return end idxNewStep= sf:getLineCount() + 1 if (sf:getLine(idxCurStep):isStepMeta()) then --print('curStep has no items, but at last step we get directly the STEP line; use curStep for insert') addNewStep=false --else --print('curStep has items') end end --collect all selectect Items, because on moving the selection object will be damaged local refList= {} for i=1,refCnt do local ref= sel:getRef(i) refList[i]= {} refList[i].ref= sel:getRef(i) refList[i].correctIdx= ref:getLineIndex() < idxNewStep end local useHelpLine if (idxNewStep > sf:getLineCount()) then useHelpLine= idxNewStep sf:addNewLine(idxNewStep, 'temporary helpline for tail-insert') end for i=1,refCnt do sf:moveLine(refList[i].ref, idxNewStep) if refList[i].correctIdx then idxNewStep= idxNewStep-1 end end if (useHelpLine) then sf:deleteLine(useHelpLine) end if (addNewStep) then sf:addNewLine(idxNewStep, '0 STEP') ses:setCurStepNr(curStep) end end end --Insert selected Steps into a new Step after current step ============================================================================================================= function runSelInsStep() insertSelectionIntoNextStep(true) end --Insert selected Steps into next Step after current step ============================================================================================================= function runSelInsNextStep() insertSelectionIntoNextStep(false) end macro:register('Move selection to new step') macro:setHint('This will move the selection to a new step after the current one.') macro:setEvent('run', 'runSelInsStep') macro:register('Move selection to next step') macro:setHint('This will move the selection to the next step after the current one.') macro:setEvent('run', 'runSelInsNextStep')
  4. Thanks for reply, but if you have a long list of parts, than it is a lot of scrolling, do drop to the right step. Currently I have open the stepLIst, the source window and the reorganizing move step. Than I select the parts and click on the step after higlighted in the moving step window. I like it, if i move a part, that it wil be move away, without hidding, because I am in the Step before. If a than use a new Step, I click in the step Window to next Step (or by keboard), click Insert and go to the previous Step. It is only a wish, and I think the both function are more or less trivial to programming (I currently try to understand the lua api, than I can make these function by myself, but without debugging and understanding the full api, it is a little bit hard...)
  5. Hi, first of all thank you for the Great Tool. I am also often get lxf Files(LDD). I Translate it with lxf2ldr, bedaure it uses the subgroups as submodules. Than I trying to add steps by disassembling the model backwards. And here is my question or suggestion. It would be helpful if there were an "insertAfter step " function that would insert an new empty step after the current step without leaving the current step. Then there should be a "Move selection to Next Step" function, which inserts the parts in reverse order as selected. Of course, it would be even better if there were a disassemble mode, which would move each clicked part to the first position of the next step. Do you think, this could be possible? Dirk