{"action":"created","issue":{"url":"https://api.github.com/repos/trevorsandy/lpub3d/issues/44","repository_url":"https://api.github.com/repos/trevorsandy/lpub3d","labels_url":"https://api.github.com/repos/trevorsandy/lpub3d/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/trevorsandy/lpub3d/issues/44/comments","events_url":"https://api.github.com/repos/trevorsandy/lpub3d/issues/44/events","html_url":"https://github.com/trevorsandy/lpub3d/issues/44","id":310667890,"number":44,"title":"[Reopened] LPub3D inserting extra INSERT MODEL/INSERT PAGE","user":{"login":"d-j-m-0","id":37604323,"avatar_url":"https://avatars0.githubusercontent.com/u/37604323?v=4","gravatar_id":"","url":"https://api.github.com/users/d-j-m-0","html_url":"https://github.com/d-j-m-0","followers_url":"https://api.github.com/users/d-j-m-0/followers","following_url":"https://api.github.com/users/d-j-m-0/following{/other_user}","gists_url":"https://api.github.com/users/d-j-m-0/gists{/gist_id}","starred_url":"https://api.github.com/users/d-j-m-0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d-j-m-0/subscriptions","organizations_url":"https://api.github.com/users/d-j-m-0/orgs","repos_url":"https://api.github.com/users/d-j-m-0/repos","events_url":"https://api.github.com/users/d-j-m-0/events{/privacy}","received_events_url":"https://api.github.com/users/d-j-m-0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-03T02:04:34Z","updated_at":"2018-04-03T04:13:35Z","closed_at":null,"author_association":"NONE","body":"Details as per issue #39, which has been marked as closed but still occurs with release 2.2.1.\r\n\r\nThe attached zip file contains two example LDR files. motor_pin.ldr exhibits the behaviour described in issue #39. motor_pin_01.ldr does not exhibit the behaviour described in issue #39. The difference between the two files is that motor_pin.ldr contains \"0 STEP\" as the last line in the file (line 9), while motor_pin_01.ldr does not contain \"0 STEP\" as its last line.\r\n\r\nIt appears that the logic detecting whether or not the model already contains the commands \"0 !LPUB INSERT MODEL\" and \"0 !LPUB INSERT PAGE\" is failing to take into account the (any?) trailing command.\r\n\r\n[motor_pin_2.zip](https://github.com/trevorsandy/lpub3d/files/1869935/motor_pin_2.zip)\r\n"},"comment":{"url":"https://api.github.com/repos/trevorsandy/lpub3d/issues/comments/378122842","html_url":"https://github.com/trevorsandy/lpub3d/issues/44#issuecomment-378122842","issue_url":"https://api.github.com/repos/trevorsandy/lpub3d/issues/44","id":378122842,"user":{"login":"trevorsandy","id":13388970,"avatar_url":"https://avatars3.githubusercontent.com/u/13388970?v=4","gravatar_id":"","url":"https://api.github.com/users/trevorsandy","html_url":"https://github.com/trevorsandy","followers_url":"https://api.github.com/users/trevorsandy/followers","following_url":"https://api.github.com/users/trevorsandy/following{/other_user}","gists_url":"https://api.github.com/users/trevorsandy/gists{/gist_id}","starred_url":"https://api.github.com/users/trevorsandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevorsandy/subscriptions","organizations_url":"https://api.github.com/users/trevorsandy/orgs","repos_url":"https://api.github.com/users/trevorsandy/repos","events_url":"https://api.github.com/users/trevorsandy/events{/privacy}","received_events_url":"https://api.github.com/users/trevorsandy/received_events","type":"User","site_admin":false},"created_at":"2018-04-03T04:13:35Z","updated_at":"2018-04-03T04:13:35Z","author_association":"OWNER","body":"Thanks for the additional details. \r\n\r\nThe `0 !LPUB INSERT MODEL` meta command was designed to be automatically added as the last step [final model] if Fade Step is ON. By design, it can also be used manually anywhere in the model. The automatic placement logic starts at the end of the main model file and traverses backward until it encounters `0 !STEP`, `0 !ROTSTEP`, StepGroup, or `0 !LPUB INSERT MODEL`.\r\n\r\nIf you manually insert `0 !STEP` after an existing `0 !LPUB INSERT MODEL` meta command, LPub3D, by design, will ignore this occurrence of INSERT MODEL and insert a final model’s `0 !LPUB INSERT MODEL` meta command. It looks like this is the behaviour you are experiencing with motor_pin.ldr.\r\n\r\nAs I am writing this, I can think of a scenario where a `0 !LPUB INSERT MODEL` meta may be added unexpectedly which is after another ‘insert’ meta command - e.g. BOM, Picture etc... where a `0 !STEP` command separates the insert command(s). I will change the logic for this scenario to test for lines starting with 1 - 5 after encountering `0 !STEP`as the pre-condition to inserting the INSERT MODEL command versus only testing for `0 !STEP`. This change will not affect the scenario you presented which will continue as designed.\r\n\r\nCheers,\r\n\r\n"}}
{"actor":{"display_login":"trevorsandy"}}